|text to get| Other text.... migh have "|"'s ...
How can I get the text to get stuff from the string (and remove it)?
text to get
It should be just the first match
var test_str = "|text to get| Other text.... migh have "|"'s ..."; var start_pos = test_str.indexOf('|') + 1; var end_pos = test_str.indexOf('|',start_pos); var text_to_get = test_str.substring(start_pos,end_pos) alert(text_to_get);
1.4m articles
1.4m replys
5 comments
57.0k users