Java, get the data from the line.



  • Line

    24 Example 62.34 7 
    

    We need to get everything that comes after the first number:

    Example 62.34 7 
    


  • You can do different ways. Like regulars. But if you always have a gap after the first number, you can just break the gap on the mass and drop the first element over again:

    String input = "24 Example 62.34 7";
    String[] array = input.split(" ");
    String result = "";
    

    for(int i = 1; i<array.lenght; i++)
    {
    result += array[i];
    if(i != array.lenght-1) result+=" ";
    }




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2