Get Specific part of a String in Javascript
Posted
by streetparade
on Stack Overflow
See other posts from Stack Overflow
or by streetparade
Published on 2010-03-18T14:03:32Z
Indexed on
2010/03/18
14:31 UTC
Read the original article
Hit count: 466
I have a string containing something like this
"Hello bla bla bla bla ok, once more bla können. // this is static: it doesn't change
This is a text, this also a text. // this is dynamically added text it can change each time
My name mysurename // this is also static text
www.blabla.com
"
Now I have content and I have to get the first part of the string and the third part, I want to be able to have 3 parts, I think I have to split it using something like split();
string1 = "Hello bla bla bla bla ok, once more bla können.;
string2 = ""; // i have this part
string3 ="My name mysurename";
If it helps the first part ends with "können. "
and the third part ends with the url above // its a fictional URL
© Stack Overflow or respective owner