Removing Characters in String

Discussion in 'Plugin Development' started by Acer_Mortem, Nov 29, 2013.

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

    Acer_Mortem

    I have a string thats (lets just say) 22 characters. How can I cut off the last few characters so the string is just 16 characters long?
     
  2. Offline

    RainoBoy97

    "hello there how are you".substring(0, 15);
    Would return "hello there how "!
     
  3. Offline

    Blah1

    string.substring(0, string.length() -6)
     
  4. Offline

    Acer_Mortem

    Blah1

    Okay, how could I remove this from the original string? I tried replacing the sequence with null, but that doesn't work.
     
  5. Offline

    hellboyPS

  6. Offline

    Blah1

    What do you mean?

    String s = string.substring...
    Then just use s as your new string now
     
    Acer_Mortem likes this.
  7. Offline

    Acer_Mortem

    Blah1

    I feel stupid..
     
Thread Status:
Not open for further replies.

Share This Page