How to compare String with " ?

L

lemnfoon

Hi i need to compare a string that has " at the front and the back.
how do i compare it ?

Thanks
 
A

Arne Vajhøj

Hi i need to compare a string that has " at the front and the back.
how do i compare it ?

..equals works fin on String's even with double quotes in them.

Are you asking how to get double quotes in a literal String ?

if(s.equals("\"foobar\"")) {

Arne
 
L

lemnfoon

.equals works fin on String's even with double quotes in them.

Are you asking how to get double quotes in a literal String ?

if(s.equals("\"foobar\"")) {

Arne

OK. thanks
Another question,
how do i split a string using "/"?

for example www.yahoo.com/abc
i wan to split into www.yahoo.com and abc.

tried this but cannot work ?
String[] subStringAdd = str.split("\\/");
 
L

lemnfoon

.equals works fin on String's even with double quotes in them.
Are you asking how to get double quotes in a literal String ?
if(s.equals("\"foobar\"")) {

OK. thanks
Another question,
how do i split a string using "/"?

for examplewww.yahoo.com/abc
i wan to split intowww.yahoo.comand abc.

tried this but cannot work ?
String[] subStringAdd = str.split("\\/");

solve this.. my code error..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top