Ad
How To Split String By Multiple Delimiters In Flutter?
This looks like a simple question, but I couldn't find any result after google.
I have string tel:090-1234-9876 03-9876-4321 +81-90-1987-3254
, I want to split it to tel:
, 090-1234-9876
, 03-9876-4321
and +81-90-1987-3254
, what can I do?
Ad
Answer
Simply you can use the split()
method of the Dart as follows.
final str = "tel:090-1234-9876 03-9876-4321 +81-90-1987-3254";
print(str.split(" "));
If you want to use any other pattern, try splitting using regex.
final str = "tel: 090-1234-9876 03-9876-4321 +81-90-1987-3254";
print(str.split(new RegExp(r'\s')));
Ad
source: stackoverflow.com
Related Questions
- → I can't convert Json to string [OctoberCms]
- → Passing a JS var from AJAX response to Twig
- → how to convert stdclass into string
- → Dynamic url segment name in laravel 5.1
- → Knockout JS - How to return empty strings for observable fields
- → How to replace *( in a string
- → Removing a JavaScript property inside a specific Object within an Array
- → Is this considered to be a custom facade approach in Laravel?
- → JavaScript: How would I reverse ONLY the words in a string
- → How to access a complex object comming from a datatable cell in JQuery/Javascript
- → Regex extract string after the second "." dot character at the end of a string
- → Htaccess negation
- → Convert generic text string in json object into valid url using Angular
Ad