How to trim a string after a specific character in java -
i have string variable in java having value:
string result="34.1 -118.33\n<!--abcdefg-->";
i want final string contain value:
string result="34.1 -118.33";
how can this? i'm new java programming language.
thanks,
you can use:
result = result.split("\n")[0];
Comments
Post a Comment