Join 500+ Software Testing professionals. Solve problem and get your problem solved. Register Now!

0
java split string using . dot does not work

Solved 1 Answers 50 Views Programming
0 1
I am trying to split string using Java split function but it does not split string.

 

this.getClass().getName().split(".");

1 Answer

0
Best answer
0

java.lang.String.split splits on regular expressions, and . in a regular expression means "any character".

Try this.getClass().getName().split("\\.").

 

answered by
selected by

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.
...