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 ?!
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With