Skip to main content
added 1 characters in body
Source Link
Rahul Tripathi
  • 173.3k
  • 33
  • 292
  • 341

You may try like this:-

String str= args[args.length-1]; 

And to get the last character:-

char ch = str.charAt(str.length() - 1); 

You may try like this:-

String str= args[args.length-1]; 

And to get the last character:

char ch = str.charAt(str.length() - 1); 

You may try like this:-

String str= args[args.length-1]; 

And to get the last character:-

char ch = str.charAt(str.length() - 1); 
Source Link
Rahul Tripathi
  • 173.3k
  • 33
  • 292
  • 341

You may try like this:-

String str= args[args.length-1]; 

And to get the last character:

char ch = str.charAt(str.length() - 1);