Solved Splitting a string, getting everything after 1 word

Discussion in 'Plugin Development' started by sgavster, Feb 1, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    sgavster

    Hello!
    I'm making a quick feature for my server and I need to split an inputted string, but get everything after the first split string, I have this code:
    HTML:
    String[] split = e.getMessage().split(":");
    and then I use
    HTML:
    if(split[0].equalsIgnoreCase("1")) {
    but now I need to get the rest of the text (everything except for the 1) how can I do this?

    Thanks!
     
  2. Offline

    teej107

    @sgavster Loop through the array starting at the 1st index
     
  3. Offline

    JTGaming2012

    Use a for loop to loop through the rest of the values??
     
  4. Offline

    sgavster

    @teej107 @JTGaming2012 I thought I could do this:
    HTML:
                for(String sp : split) {
                   
                }
    But I can't figure out how to start at the first index.
     
  5. Offline

    JTGaming2012

    Code:
    for(int i = 1; i < split.length; i ++) {
        String value = split[i];
    }
     
  6. Offline

    sgavster

Thread Status:
Not open for further replies.

Share This Page