Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android How to Remove( " )Character from String

Tags:

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 ?!

like image 551
alireza amini Avatar asked Sep 05 '15 14:09

alireza amini


People also ask

How do I remove a specific character from a string?

You can also remove a specified character or substring from a string by calling the String. Replace(String, String) method and specifying an empty string (String. Empty) as the replacement. The following example removes all commas from a string.

How do I remove characters from string Kotlin?

Since strings are immutable in Kotlin, we can't remove characters from it. However, we can create a new string with the first n characters removed. This can be done using the substring() function with the starting index n , which creates a substring starting from position n till its end.

How do you remove a substring from a string?

To remove a substring from a string, call the replace() method, passing it the substring and an empty string as parameters, e.g. str. replace("example", "") . The replace() method will return a new string, where the first occurrence of the supplied substring is removed.


1 Answers

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.

like image 67
Cina Ebra Avatar answered Sep 24 '22 01:09

Cina Ebra