• Post Reply Bookmark Topic Watch Topic
  • New Topic

Replace Double Quote and Single Quotes  RSS feed

 
Ranch Hand
Posts: 1800
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my javascript how can I replace "" and ' with "in" and "sec"?
 
Author and ninkuma
Marshal
Posts: 66346
155
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you looked through the API for the String class?
 
Steve Dyke
Ranch Hand
Posts: 1800
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes but myString.replace('"',"in") will not change 123" to 123in for some reason.
 
Steve Dyke
Ranch Hand
Posts: 1800
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got it to work using '\"'
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!