Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in Javascript only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Today's Posts
Member List
Calendar
Home
Forum
Topic
Javascript
replace string at index
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
oll3i
Contributor
Join Date:
Mar 2007
Posts:
679
#1
replace string at index
Feb 20 '08, 01:02 PM
Is it possible to replace a string indicating start and end positions ?
thank You
hsriat
Recognized Expert
Top Contributor
Join Date:
Jan 2008
Posts:
1653
#2
Feb 20 '08, 01:08 PM
Originally posted by
oll3i
Is it possible to replace a string indicating start and end positions ?
thank You
can you plz explain....
Comment
Post
Cancel
oll3i
Contributor
Join Date:
Mar 2007
Posts:
679
#3
Feb 20 '08, 01:35 PM
I want to replace some text in a string indicating the start and end position and I want to remove some pattern from a string indicating position
Comment
Post
Cancel
hsriat
Recognized Expert
Top Contributor
Join Date:
Jan 2008
Posts:
1653
#4
Feb 20 '08, 01:44 PM
Originally posted by
oll3i
I want to replace some text in a string indicating the start and end position and I want to remove some pattern from a string indicating position
404 - Page not found | W3Schools.com
http://www.w3schools.com/js/js_obj_regexp.asp
Sorry! We can't seem to find the resource you're looking for
Comment
Post
Cancel
mrhoo
Contributor
Join Date:
Jun 2006
Posts:
428
#5
Feb 20 '08, 03:12 PM
str=str.slice(s tartindex,endin dex)
negative numbers in the second argument count from the end of the string
escape any slashes in the rx
(It takes 2 idelimeters in a string construction)
var reg = new RegExp("<b>"+tx t
+"<\\/b>");
Comment
Post
Cancel
oll3i
Contributor
Join Date:
Mar 2007
Posts:
679
#6
Feb 20 '08, 03:12 PM
thank You
now i need the reg exp to be "<b>" some text "</b>"
var reg = new RegExp("<b>"+tx t+"</b>"); throws an error
txt is a passed string
Comment
Post
Cancel
oll3i
Contributor
Join Date:
Mar 2007
Posts:
679
#7
Feb 20 '08, 03:37 PM
it didnt work cos test method is case sensitive :) now works
thank You
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment