I have an overriding method with String which returns String in format of:
"abc,cde,def,fgh"
I want to split the string content into two parts:
String before first comma and
String after first comma
My overriding method is :
@Override
protected void onPostExecute(String addressText) {
placeTitle.setText(addressText);
}
Now how do I split the string into two parts, so that I can use them to set the text in two different TextView
?
You may use the following code snippet
String str ="abc,cde,def,fgh";
String kept = str.substring( 0, str.indexOf(","));
String remainder = str.substring(str.indexOf(",")+1, str.length());