I'm trying to take a word (stEAdy) and find the index positions of the uppercase characters(2,3) in the word. I have them stored in an array (positionarray) . Then I reverse the word and set all characters to lowercase. I've done that. Now, I want to take the reversed word (ydaets) and make the index positions from the array(2,3) uppercase for the reversed word, so that it will read (ydAEts). Below I'm looping thur the array incorrectly. I'm only able to get the first index position set. Any suggestions on setting up the loop correctly?
Thanks,
Wbosw
Thanks,
Wbosw
Code:
'loop thur the position array, giving the position of the capital letters in each word
For Each Charposition As Byte In PositionArray
'set byte variable for For loop
Dim j As Byte
'declare Char variable to hold the actual characters
Dim char2 As Char
'set finalstring to nothing
finalString = " "
'loop thur each word to see which positions are equal to the positions in the array
For j = 0 To LowerRevText.Length - 1
char2 = LowerRevText.Chars(j)
'if the positions are equal then change the character to Uppercase
If Charposition = j Then
'change the position to uppercase
CapChar = Char.ToUpper(char2)
'set char2 equal to CapChar
char2 = CapChar
End If
CapRevText += char2
Next
'add a space between the words
finalString += CapRevText + " "
'set variable = to nothing
CapRevText = " "
Next
Comment