power_settings_new

java split string using . dot does not work

by
0 votes
61 views
I am trying to split string using Java split function but it does not split string.

 

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

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.

1 Answer

by
selected by
0 votes
 
Best answer

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

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

 

add
...