Jeet Bhalujeetbhalu.hashnode.dev·Mar 14, 2024Dart Extension MethodDart extensions allow you to add new functionality to existing classes, including classes that you don't have access to modify. Example: extension StringExtension on String { int customLength() { return this.length * 2; } } void main() { ...DiscussExtension method
Jeet Bhalujeetbhalu.hashnode.dev·Mar 13, 2024Dart String Manipulations: Strings RegExpWhat is RegExp? Regular expressions are Patterns, and can as such be used to match strings or parts of strings. Regex in Dart works much like other languages. You use the RegExp to define a matching pattern. Then use hasMatch() to test the pattern ...DiscussDart String Manipulations: Strings RegExp
Jeet Bhalujeetbhalu.hashnode.dev·Mar 13, 2024Dart String Manipulations: Strings contains()contains: The contains method is used to check if a given element is present in a list. It takes one argument, which is the element to be searched for in the list. If the element is found in the list, the method returns true.Otherwise, it returns fa...DiscussDart String Manipulations: Strings contains()
Jeet Bhalujeetbhalu.hashnode.dev·Mar 13, 2024Dart String Manipulations: Strings startWith & endsWithStartWith: A startWith() is in string a start is check your sentence is your word and character is ok to use character check. Example: void main() { String str = "Hello World!"; print(str.startsWith('H')); } Output: true EndWith: your ...DiscussDart String Manipulations: Strings startWith & endsWith
Jeet Bhalujeetbhalu.hashnode.dev·Mar 13, 2024Dart String Manipulations: Strings ValidationsStrings validation : In dart string validation is check to your string field email is correct or incorrect email a email is correct to your answer is true and email is not correct to answer is false in String filed is checked Example: void main() {...DiscussString validation
Jeet Bhalujeetbhalu.hashnode.dev·Mar 13, 2024Dart String Manipulations: Building Strings in loopWhat is Loop? A loop is used in Dart or any other programming language to repeat a sequence of commands a given number of times or until it satisfies a condition. Exapmle: void main() { int i; for (i = 2; i <= 1024; i *= 2) { ...DiscussString in loop
Jeet Bhalujeetbhalu.hashnode.dev·Mar 13, 2024Dart String Manipulations: String BufferStringBuffer: A StringBuffer is use to multiple data add in one string to use and StringBuffer is provide multiple sequence characters. void main() { StringBuffer str =StringBuffer(); str.write("Hello"); str.write(","); s...DiscussDart String Manipulations: String Buffer
Jeet Bhalujeetbhalu.hashnode.dev·Mar 13, 2024Dart String Manipulations: Replacing & SearchingReplacing: You can use replaceAll() method to use string method to use sentence change to use replaceAll() method void main() { String str = "hi kem cho?"; String rep; rep = str.replaceAll('hi', 'jeet'); print(rep); } Outp...DiscussDart String Manipulations: Replacing & Searching