Get a number between () in a item lore?

Discussion in 'Plugin Development' started by Slash9211, Oct 14, 2014.

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

    Slash9211

    How would I get a number in between ()?
    EX: (10) How would I get the 10?
     
  2. Offline

    mythbusterma

    Slash9211

    Find the index of each parentheses, substring between them, cast to integer, profit.
     
  3. Offline

    SmooshCakez

    Slash9211 Substring between the parentheses, or remove all non numbers from the string [string.replaceAll("[\\D]", "")], then parse the integer.
     
Thread Status:
Not open for further replies.

Share This Page