Showing
1 changed file
with
3 additions
and
6 deletions
@@ -535,11 +535,7 @@ class GetUtils { | @@ -535,11 +535,7 @@ class GetUtils { | ||
535 | /// Remove all whitespace inside string | 535 | /// Remove all whitespace inside string |
536 | /// Example: your name => yourname | 536 | /// Example: your name => yourname |
537 | static String removeAllWhitespace(String value) { | 537 | static String removeAllWhitespace(String value) { |
538 | - if (isNullOrBlank(value)) { | ||
539 | - return null; | ||
540 | - } | ||
541 | - | ||
542 | - return value.replaceAll(' ', ''); | 538 | + return value?.replaceAll(' ', ''); |
543 | } | 539 | } |
544 | 540 | ||
545 | /// Camelcase string | 541 | /// Camelcase string |
@@ -549,7 +545,8 @@ class GetUtils { | @@ -549,7 +545,8 @@ class GetUtils { | ||
549 | return null; | 545 | return null; |
550 | } | 546 | } |
551 | 547 | ||
552 | - final separatedWords = value.split(' '); | 548 | + final separatedWords = |
549 | + value.split(RegExp(r'[!@#<>?":`~;[\]\\|=+)(*&^%-\s_]+')); | ||
553 | var newString = ''; | 550 | var newString = ''; |
554 | 551 | ||
555 | for (final word in separatedWords) { | 552 | for (final word in separatedWords) { |
-
Please register or login to post a comment