JavaScript........
#1
Scooby Senior
Thread Starter
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?
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?
#2
Scooby Regular
Join Date: Jul 2002
Location: Northants Gamertag: ThunderXUK
Posts: 554
Likes: 0
Received 0 Likes
on
0 Posts
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
http://developer.netscape.com/docs/m...ng.htm#1196895