Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
値 = 1.0.0 の String を受け取りましたが、String 値が分割されると、String[] は値なしの [] です!!
String vS = getValue(); String[] str = vS.trim().split(".");
しかし、デバッグ モードでは、vS の値は : 1, .0, .0 で、理由がわからない?!
これは、split()メソッドが正規表現を使用し、任意の文字.に一致する正規表現であるためです。次のように変更します。
split()
.
String[] str = vS.trim().split("[.]");