Javascript Replace
-
I want to replace a specified subString is a string by javascript. I don't know the exact substring part, just I know it starts with
Best wishes
-
I want to replace a specified subString is a string by javascript. I don't know the exact substring part, just I know it starts with
Best wishes
The string object in JavaScript has a replace method, so if you need to do more than a simple replace then we'd need some details. From http://www.w3schools.com/jsref/jsref_replace.asp[^]: Syntax stringObject.replace(findstring,newstring) Parameter Description findstring Required. Specifies a string value to find. To perform a global search add a 'g' flag to this parameter and to perform a case-insensitive search add an 'i' flag newstring Required. Specifies the string to replace the found value from findstring If you need to simulate the .startsWith function in JavaScript then here's an article that demonstrates how to do so using regular expressions: http://www.tek-tips.com/faqs.cfm?fid=6620[^] If you need to do something different then let us know. Regards,
Ray Wampler www.RayWampler.com