0
18th Oct 2020, 1:27 PM
Sindhuja Selvakumar
Sindhuja Selvakumar - avatar
7 odpowiedzi
+ 2
zahraa 🇱🇧 you're welcome.. And thanks for understanding... 👍👍👍
18th Oct 2020, 2:13 PM
Jayakrishna 🇮🇳
+ 2
Jayakrishna🇮🇳 you're right, I'm sorry. I got mixed up. Thanks for your attention 🌸 Sindhuja Selvakumar I was mistaken, I edited my comment.
18th Oct 2020, 1:56 PM
zahraa 🇱🇧
zahraa 🇱🇧 - avatar
+ 1
System.out.println(a.replaceAll("[0:9]",(""))); The 1st argument, is a regex of a class of consisting 3 charecters '0',':','9'. And these 3 are replaced by "" empty charecter in a new formed string.
18th Oct 2020, 1:34 PM
Jayakrishna 🇮🇳
+ 1
String a="java99s155";: this statement assigns the value "java99s155" to the variable a (which of type string) System.out.println(a.replaceAll("[0:9]",(""))): this statement search for all occurences of the characters ('0',':','9') in string a ([0:9] can be translated as the three characters '0',':','9') and replace those characters by empty strings ( "" means empty string) As a conclusion, this program prints a string which is "the string a converted to a string free of characters '0',':', and '9'."
18th Oct 2020, 1:37 PM
zahraa 🇱🇧
zahraa 🇱🇧 - avatar
+ 1
Wow super explanation tq soo much the program was clear now
18th Oct 2020, 1:39 PM
Sindhuja Selvakumar
Sindhuja Selvakumar - avatar
+ 1
Anytime 🌸
18th Oct 2020, 1:41 PM
zahraa 🇱🇧
zahraa 🇱🇧 - avatar
+ 1
I want to add, "[0:9]" - Not Replace all the numbers.. Just 3 charecters. Check the output.. To replaceall numbers,you need to use "[0-9]".
18th Oct 2020, 1:45 PM
Jayakrishna 🇮🇳