Solved

replace backslashes by slashes

Posted on 2007-12-07
7
2,900 Views
Last Modified: 2013-12-29
Hello,

I want to replace backslashes "\" by slashes "/" in a  string.

Thank you !
0
Comment
Question by:matthew016
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 92

Assisted Solution

by:objects
objects earned 100 total points
ID: 20426628
s = s.replaceAll("\\\\", "/");
0
 
LVL 26

Assisted Solution

by:ksivananth
ksivananth earned 50 total points
ID: 20426629
string.replaceAll( "\\\\", "/" ) ;
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 200 total points
ID: 20426651
More efficient:

s = s.replace('\\', '/');
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 9

Assisted Solution

by:ysnky
ysnky earned 150 total points
ID: 20426703
0
 
LVL 9

Author Comment

by:matthew016
ID: 20426980
okkk thanks !!
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 20427041
:-)
0
 
LVL 92

Expert Comment

by:objects
ID: 20427627
its not more efficient btw :)
not even the same thing
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
even odd program using while loop 3 74
How to determine if a string is a valid SHA value 7 44
Convert from a json string array to a Java object 3 65
java example issue 5 46
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question