Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

how to replace string character in dart

void main(){
     
    String str = 'Hello TutorialKart. Hello User.';
     
    //replace subString
    String result = str.replaceAll('Hello', 'Hi');
     
    print(result);
}
Output:
Hi TutorialKart. Hi User.
---------------------------------
void main(){
     
    String str = 'Hello TutorialKart. Hello User.';
     
    //replaceAll() chaining
    String result = str.replaceAll('Hello', 'Hi').replaceAll('User', 'Client');
     
    print(result);
}

Output:
Hi TutorialKart. Hi Client.
Source by www.tutorialkart.com #
 
PREVIOUS NEXT
Tagged: #replace #string #character #dart
ADD COMMENT
Topic
Name
8+9 =