alireza amini
alireza amini

Reputation: 1742

Android How to Remove( " )Character from String

I wanted to to Remove ( " ) Character from String

This is my text

"69452;6486699"

I need to Have This Text

69452;6486699

I've tryed to use String.Replace

 text = text.replace(""","");

and does not work

Also I've Use This Way

 text = text.replace("/"","");

But Not Again

Any One Can Help me ?!

Upvotes: 23

Views: 64191

Answers (4)

Cina Ebra
Cina Ebra

Reputation: 526

use this code

text.replace("\"", "");

Backslash () is used for escaping special characters, forward slash (/) is just a regular character with no special meaning in the string.

Upvotes: 40

Fruchtzwerg
Fruchtzwerg

Reputation: 11399

Wrong slash. Do it with a backslash:

text = text.replace("\"", "");

Upvotes: 6

King of Masses
King of Masses

Reputation: 18775

You need to try like this

text = text.replace("\"", "");

Look into String.replace()

Upvotes: 2

Luke
Luke

Reputation: 1344

It's

text = text.replace("\"", "");

Backslash (\) is used for escaping special characters, forward slash (/) is just a regular character with no special meaning.

Upvotes: 5

Related Questions