ok, my brain is bleeding....
Is there a way in JavaScript to replace a segment of a string WITHOUT using regular expressions? I have a hidden form item which contains a string of numbers with delimiters: e.g. ,2,234,24,87,89,290, I am passing a function a number I want to remove from the string: e.g. 234 Without using a regular expression, I want the string to become: ,2,24,87,89,290, any ideas? |
you could use String.indexOf to get the position and then take apart the string left of the index and add the remainder back on?!
http://developer.netscape.com/docs/m...ng.htm#1196895 |
You may also want to put it in a loop to replace every occurance of the string, not just the first...
|
cheers guys :)
|
|
Dizzy - WITHOUT using regular expressions
all sorted now WITHOUT re's :) |
All times are GMT +1. The time now is 02:56 PM. |
© 2024 MH Sub I, LLC dba Internet Brands