I'm having a problem parsing String to long. The string in question is a number that's preceded with spaces. For example: " 35".
NetBeans threw this error:
Exception in thread "main" java.lang.NumberFormatException: For input string: " 35"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Long.parseLong(Long.java:578)
at java.lang.Long.parseLong(Long.java:631)
at Sis1.main(Sis1.java:75)
/Users/michaeladrian39/Library/Caches/NetBeans/8.1/executor-snippets/run.xml:53: Java returned: 1
BUILD FAILED (total time: 0 seconds)
I want to parse the String "35" without the spaces to long. How to fix this error?