Get ints from a string

Discussion in 'BungeeCord Plugin Development' started by Creepermanthe3rd, Apr 17, 2017.

Thread Status:
Not open for further replies.
  1. Yo, im making a bank note plugin(private so no config) and I'm having trouble with how I should go about getting the amount of money on the note. When you get the note the amount of money withdrawn is on the display name and lore. But how could I get the number that's on the name or lore.
     
    • Useful Useful x 1
  2. Code (Text):

    public int isInt(String str){
    try {
    int number = Integer.parseInt(str);
    return number;
    } catch(NumberFormatExeption err){
    System.out.println("Not a number !");
    return null;
    err.printstacktrace();
    }
    Should work ;)
     
Thread Status:
Not open for further replies.