Posted By

Webbanditten on 08/17/12


Tagged

split


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

spee66
BrockSamsom
Priestd09


Split text with jQuery


 / Published in: jQuery
 

Simple splitting of a string, just change [0] to [1] if you want to get the text after the ";#" you can change that too.

  1. function getID(value) {
  2. returnvalue = value.split(/;#/)[0];
  3. return returnvalue;
  4. }
  5. var text = '1;#Athene';
  6. var abc = getID(text);
  7. console.log(abc);

Report this snippet  

You need to login to post a comment.