java - How to split a String array? -
Replace a current row (string containing commas), replace white space with "" (trim space) and Finally, split string elements into arrays.
Why does not this work?
string [] textLine = currentInputLine.replace ("\\ S", "") .split (",");
I think you want to replace. Instead of
and replaced all ("\\ s", "")
will remove all the spaces, not just unnecessary ones if it is not what you want You should replace All ("\\ s +", "\\ s")
or something like that.
Comments
Post a Comment