Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Created by Oscar on 3/8/17.
- */
- public class Test {
- public static void main(String[] args) {
- String incomingMessage = "!sysmsg jid@talk.com otherjid@talk.com All the rest of the text here";
- String[] arr = incomingMessage.split("\\s+");
- if (arr.length < 4) {
- System.out.println("not a sysmsg");
- return;
- }
- String iWantThisText = arr[1];
- String thisText = arr[2];
- String andThisText = incomingMessage.substring(incomingMessage.indexOf(thisText) + thisText.length() + 1);
- System.out.println(iWantThisText + "\n" + thisText + "\n" + andThisText);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement