Dim txt As String = RichTextBox1.Text
txt.Replace("a", "1")
txt.Replace("b", "2")
txt.Replace("c", "3")
RichTextBox1.Text = txt
Dim txt As String = RichTextBox1.Text
txt = txt.Replace("a", "1")
txt = txt.Replace("b", "2")
txt = txt.Replace("c", "3")
RichTextBox1.Text = txt
Dim str1 As String = Me.TextBox1.Text
Dim str2 As String
Dim ch As Char
For Each ch In str1
str2 &= (Convert.ToInt32(Char.ToUpper(ch)) - 64).ToString()
Next ch
MsgBox(str2)
Nice code.aniskhan said:VB.NET:Dim str1 As String = Me.TextBox1.Text Dim str2 As String Dim ch As Char For Each ch In str1 str2 &= (Convert.ToInt32(Char.ToUpper(ch)) - 64).ToString() Next ch MsgBox(str2)
The first word ends at the first space, so you can use String.Substring and String.IndexOf together to get the substring up to the index of the first space.CoDeR said:thanks for all the help, that part works great now but is there a way to select individual word without knowing what they are going to be. so when the button is clicked it will find the first word and put it into a variable![]()