Your Ad Here

Posted By

lfatr on 02/16/10


Tagged


Versions (?)

CUT STRING AFTER FUNCTION


 / Published in: JavaScript
 

  1. <?js
  2.  
  3. function cleanString(string, del) {
  4. if (string.indexOf(del) > -1) {
  5. string = string.substr(0, string.indexOf('#'));
  6. }
  7. return string;
  8. }
  9.  
  10. ?>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: lfatr on February 16, 2010

nice too var alt = item.name; var altStripped = alt.replace(/#./, '');

You need to login to post a comment.