Split String with .(dot) character java android
本问题已经有最佳答案,请猛点这里访问。
你好,朋友们,我有一根绳子
1 | Android_a_b.pdf |
我想像
我试着像这样遵循代码
1 2 3 4 |
当我运行上面的代码时,它会给我如下的错误
1 | 11-05 09:42:28.922: E/AndroidRuntime(8722): Caused by: java.lang.ArrayIndexOutOfBoundsException: length=0; index=0 |
在
我知道怎么解决吗?
你需要用
如:
1 2 3 4 |
现在它将被
在
Splits this string around matches of the given regular expression.
This method works as if by invoking the two-argument split method with
the given expression and a limit argument of zero. Trailing empty
strings are therefore not included in the resulting array.
记住
Parameters:
regex - the delimiting regular expression