skip to main
|
skip to sidebar
General Thoughts
Friday, April 15, 2011
JavaScript Code Snippet: Find and Replace all
Here is a JavaScript code snippet for a find and replace all.
This example code finds if there is an instance of three dashes in the string and replaces with three spaces.
if(str.indexOf('---') != -1){
str = str.replace(/---/g,' ');
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Blog Archive
►
2012
(1)
►
January
(1)
▼
2011
(8)
►
November
(2)
▼
April
(3)
Getting the Display value of a variable reference ...
Adding a Reference Field to a UI Page
JavaScript Code Snippet: Find and Replace all
►
February
(1)
►
January
(2)
►
2010
(25)
►
November
(1)
►
October
(3)
►
September
(4)
►
August
(1)
►
July
(2)
►
June
(2)
►
May
(3)
►
April
(9)
►
2009
(6)
►
August
(1)
►
July
(3)
►
June
(2)
►
2008
(5)
►
September
(2)
►
August
(3)
About Me
Dale Cox
View my complete profile
No comments:
Post a Comment