Hey folks,
How can I get substring from a string?
ex:
let’s say i got this string returned in a variable:
"I am John Wyck. I live on 123 ave. I have 1 dog named Skip.
This is my phone number 123-456-7890 and my website is www.jw.com
Please call me if you need help"
Now let’s say I want to just get “my webite is www.jw.com” from the string WITHOUT using INDEX…but only string. like get the string between “and” and “Please”
How can i do that?
I’ve tried several way…but seems like only begIndex and endIndex works… I can’t use index in this situation.
I currently use code like below with begIndex and endIndex… but this is different since i can’t use index.
String newString = getContent.split('and')[1].substring(**begIndex, endIndex**).trim()