Skip to content

Instantly share code, notes, and snippets.

@caneryilmaz
Last active January 7, 2019 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caneryilmaz/f1bda6e3a4c974292ab3ab8220d339bf to your computer and use it in GitHub Desktop.
Save caneryilmaz/f1bda6e3a4c974292ab3ab8220d339bf to your computer and use it in GitHub Desktop.
Substring
public static String makeTwoPart(String data, String cutAfterThisWord) {
String result = "";
String val1 = data.substring(0, data.indexOf(cutAfterThisWord));
String va12 = data.substring(val1.length(), data.length());
String secondWord = va12.replace(cutAfterThisWord, "");
Log.d("VAL_2", secondWord);
String firstWord = data.replace(secondWord, "");
Log.d("VAL_1", firstWord);
result = firstWord + "\n" + secondWord;
return result;
}
@caneryilmaz
Copy link
Author

this method help you for two part text from one line,
just set your all data and specific word,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment