Would anyone know how I would go about splitting a string like this using Regex?
str:String = "word1:word2:6";
I need to split it into 3 parts, the separator is :
//output
w1 = word1
w2 = word2
num = 6
Thanks,
Mark
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You don’t need to use RegExp for this.
That will create an array where each index is the characters between the common delimeter.
So:
You then can parse the array how you see fit.