Sasa Posted March 23, 2009 Report Share Posted March 23, 2009 esmu uzrakstījis šādu izstaiksmi var BarCodeStr = CodeString.replace(/-/g, "").replace(/\//g, "").replace(/_/g, "").replace(/\\/g, "").replace(/\./g, "n"); bet jābūt vēl kādam variantam kā šo visu īsāk pierakstīt? Quote Link to comment Share on other sites More sharing options...
0 bubu Posted March 23, 2009 Report Share Posted March 23, 2009 regexpos var lietot | atdalītāju starp a un b izteiksmēm. Šis atdalītās ļaus nomatchot tekstu, kurš atbilst a vai b izteiksmei. var BarCodeStr = CodeString.replace(/-|\/|_|\\|\./g, ""); Quote Link to comment Share on other sites More sharing options...
0 indoom Posted March 23, 2009 Report Share Posted March 23, 2009 Vai jautājumu par JS nebūtu jāliek JS sadaļā? .replace(/[\-\/_\\]/g,'').replace(/\./g, "n") Quote Link to comment Share on other sites More sharing options...
0 Sasa Posted March 23, 2009 Author Report Share Posted March 23, 2009 bet šī ir Iesācēju apakšsadaļa. Quote Link to comment Share on other sites More sharing options...
Question
Sasa
esmu uzrakstījis šādu izstaiksmi
bet jābūt vēl kādam variantam kā šo visu īsāk pierakstīt?
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.