Created
January 23, 2020 02:14
-
-
Save Blasanka/15bf38fbd0dd20d72b407434b9b013e7 to your computer and use it in GitHub Desktop.
This is how you can replace hash tag with forward slashes in url
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
String text = "Test #/first1hashtag test #/second2hashtag test."; | |
RegExp exp = new RegExp(r"\B#\/"); | |
exp.allMatches(text).forEach((match){ | |
print(match.group(0)); | |
text = text.replaceAll(match.group(0), ""); | |
}); | |
print(text); | |
String text2 = "Test #/first1hashtag test #/second2hashtag test."; | |
text2 = text2.replaceAll("#/", ""); | |
print(text2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment