determine if a devision result in a reminder

Signo.X

Well-known member
Joined
Aug 21, 2006
Messages
76
Location
Australia
Programming Experience
1-3
how to check if the result of a/b will have a reminder or not ???


i simply want a way to check if chars in a specific string at odd or even position !!

so im trying
' if Cint(string(i)%2) = 0 then
'do some thing..


any ideas?

thanks ..
 
Hey Signo,

Maybe something like:

VB.NET:
Dim testString as String = "i like turnips"
Dim even as boolean 
For lindex = 0 to testString.Length-1
even =  ((lindex + 1) mod 2 = 0) 
if even then
Debug.Writeline("Character: " & testString.Chars(lindex) & " is at an even position")
else
Debug.Writeline("Character: " & testString.Chars(lindex) & " is at an odd position")
end if
Next
 
Back
Top