How do i pull the middle letter out of a phrase entered through a textbox
In the textbook that I am using they supply an algorithm to determine the position of the middle character of a string which is
vb
If Len(strQuote) Mod 2 <> 0 Then
intMiddleCharPos = Len(strQuote) \ 2 + 1
Else
intMiddleCharPos = Len(strQuote) \ 2
End If
my code look like this so far
Dim strQuote As String
Dim intMiddleCharPos As Integer
strQuote = txtQuote.Text
lblF.Caption = Left(strQuote, 1)
lblL.Caption = Right(strQuote, 1)
lblM.Caption = Mid
If Len(strQuote) Mod 2 <> 0 Then
intMiddleCharPos = Len(strQuote) \ 2 + 1
Else
intMiddleCharPos = Len(strQuote) \ 2
End If
For the lblM.caption to display the middle letter what to i enter to get it to display the middle letter of a phrase being entered into a textbox
This post has been edited by powellm: 30 Mar, 2008 - 02:37 PM