aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Replaceing Characters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Replaceing Characters" Watch "Replaceing Characters" New topic
Author

Replaceing Characters

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1391
How can I use javascript to replace the / in a string?

I have tried myString.replace(///g,"") but it generates an error.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60058
    
  65

You need to bone up on regular expression syntax. because the / is used as the delimiter, you cannot just use it straight-away inside the expression. You need to delimit it the same way you would delimit a quote inside a string literal.

Try:


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Replaceing Characters
 
Similar Threads
Cant use object from another class
Posting to bump up my count...
Text box value is not being completely filled with request attribute
WA #1.....word association
The x900 effect ?