Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mid function in Java - Similar to VB?

Tags:

java

vb.net

In Visual Basic I used to use the Mid function to loop through a string and examine each character, i.e. like this:

For intPosition = 1 To strlength
    ' loop to examine each character in turn
    strchar = Mid(strstring, intposition, 1)
Next

Question is, how would I go about doing something similar using Java?

like image 521
Shakil78692 Avatar asked Mar 09 '26 07:03

Shakil78692


1 Answers

Take a look at the charAt(int) method of the String class.

like image 92
Anthony Grist Avatar answered Mar 11 '26 21:03

Anthony Grist



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!