小编Huy*_* Vũ的帖子

Can't split string in Java

I have trouble with the split function in Java. When I try to split a string with a regex "$"

String line = "Vu Quang Huy$2/11/1999$Ha Noi$Nam$CNTT$1.2$12$10000.0";
String[] properties = line.split("$");
Run Code Online (Sandbox Code Playgroud)

It doesn't do any thing. The properties at index 0 is the same as the original string

System.out.println(properties[0]);
Run Code Online (Sandbox Code Playgroud)

And it shows

Vu Quang Huy$2/11/1999$Ha Noi$Nam$CNTT$1.2$12$10000.0
Run Code Online (Sandbox Code Playgroud)

Can anyone help me with this problem? Thanks in advance!

java string split

-1
推荐指数
1
解决办法
53
查看次数

标签 统计

java ×1

split ×1

string ×1