Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Extracting Characters

$
0
0
If I were making a program that had a user-inputted string, and then I wanted to extract the first, middle, and last letter of that string and print them out, how could I do that? I know how to get the last with str.substring(str.length() - 1) but how would I do that with the first? Would it be str.substring(str.length() 0)? And I don't even know how to begin trying to get the middle character if you don't know how many characters the user has inputted. Thank you!

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>