Reputation:
I have been trying to parse a string from arguments, I have tried
String.parseString(args[0]);
what exactly am I doing wrong?
Upvotes: 0
Views: 16552
Reputation: 353
args[0]
should already be a string if it's coming from command line.
If not, use String.valueOf(args[0])
.
See http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html
Upvotes: 3
Reputation: 159754
As the args
argument in the main
method is already a String
array, you can just use args[0]
.
There is no such method String.parseString()
btw.
Upvotes: 2