Click here to Skip to main content
16,014,662 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: CPU Usage? Pin
Paul Conrad21-Oct-07 8:52
professionalPaul Conrad21-Oct-07 8:52 
GeneralRe: CPU Usage? Pin
AliAmjad21-Oct-07 9:19
AliAmjad21-Oct-07 9:19 
GeneralRe: CPU Usage? Pin
Paul Conrad21-Oct-07 15:07
professionalPaul Conrad21-Oct-07 15:07 
GeneralRe: CPU Usage? Pin
AliAmjad22-Oct-07 4:28
AliAmjad22-Oct-07 4:28 
GeneralRe: CPU Usage? Pin
AliAmjad22-Oct-07 6:31
AliAmjad22-Oct-07 6:31 
GeneralRe: CPU Usage? Pin
AliAmjad22-Oct-07 8:27
AliAmjad22-Oct-07 8:27 
QuestionSub Reports Limitation Pin
Widgets21-Oct-07 0:26
Widgets21-Oct-07 0:26 
QuestionMy code will not capitalize first letter of line Pin
Jesi52320-Oct-07 9:07
Jesi52320-Oct-07 9:07 
My input text from a .txt file is

this is the first line
this is the second line
this is the third line

I need to capitalize the first letter of each word by placing it in a textbox, I have the following code:

Dim aString As String = My.Computer.FileSystem.ReadAllText("input.txt")
Dim stringReturn As String
If My.Computer.FileSystem.FileExists("input.txt") Then
Me.xInputTextBox.Text = (Convert.ToString(aString.ToLower))
End If

Do While (aString.IndexOf(Space(2)) >= 0)
aString = aString.Replace(Space(2), Space(1))
Loop

Dim caparray() As String = (aString.Split(" " & "ControlChars.NewLine"))


For I As Integer = 0 To caparray.Length - 1
If caparray(I).Length = 1 Then
caparray(I) = caparray(I).ToUpper
Else ' ***join them back together
caparray(I) = caparray(I).Substring(0, 1).ToUpper & caparray(I).Substring(1).ToLower

End If
Next
stringReturn = String.Join(" ", caparray)
Me.xInputTextBox.Text = (stringReturn.ToString)

My output is then

This Is The First Line
this Is The Second Line
this Is The Third Line

It will not capitalize the first letter of the second and third line. Can someone please tell me what I am doing wrong?

Thanks, Jesi
AnswerRe: My code will not capitalize first letter of line Pin
Luc Pattyn20-Oct-07 9:25
sitebuilderLuc Pattyn20-Oct-07 9:25 
GeneralRe: My code will not capitalize first letter of line Pin
Jesi52320-Oct-07 9:41
Jesi52320-Oct-07 9:41 
GeneralRe: My code will not capitalize first letter of line Pin
Luc Pattyn20-Oct-07 10:27
sitebuilderLuc Pattyn20-Oct-07 10:27 
AnswerRe: My code will not capitalize first letter of line Pin
Duane in Japan21-Oct-07 4:31
Duane in Japan21-Oct-07 4:31 
QuestionHow do i call Other programs like office and Excel , Outlook From my VB App Pin
ozzyrocsdbn20-Oct-07 3:54
ozzyrocsdbn20-Oct-07 3:54 
AnswerRe: How do i call Other programs like office and Excel , Outlook From my VB App Pin
Ajay.k_Singh21-Oct-07 21:00
Ajay.k_Singh21-Oct-07 21:00 
QuestionType mismatch error for date field Pin
Trav120-Oct-07 3:00
Trav120-Oct-07 3:00 
AnswerRe: Type mismatch error for date field Pin
Guffa20-Oct-07 4:07
Guffa20-Oct-07 4:07 
QuestionHow to remove unneccessary information while writing into xml file from vb.net Pin
VB 8.020-Oct-07 2:41
VB 8.020-Oct-07 2:41 
QuestionMonitoring Printer Pin
Dawn Info19-Oct-07 22:46
Dawn Info19-Oct-07 22:46 
AnswerRe: Monitoring Printer Pin
Duncan Edwards Jones20-Oct-07 1:11
professionalDuncan Edwards Jones20-Oct-07 1:11 
QuestionHow to use .xsd file in vb.net programming while generating .xml file [modified] Pin
VB 8.019-Oct-07 22:44
VB 8.019-Oct-07 22:44 
QuestionHow to recive mail from POP3 Server in VB.Net 2005? Pin
hgs24shravgi19-Oct-07 20:38
hgs24shravgi19-Oct-07 20:38 
AnswerRe: How to recive mail from POP3 Server in VB.Net 2005? Pin
MidwestLimey22-Oct-07 12:43
professionalMidwestLimey22-Oct-07 12:43 
QuestionTechnology Conference Registration, need help Pin
jesseax19-Oct-07 16:52
jesseax19-Oct-07 16:52 
AnswerRe: Technology Conference Registration, need help Pin
Scott Dorman19-Oct-07 18:18
professionalScott Dorman19-Oct-07 18:18 
GeneralRe: Technology Conference Registration, need help Pin
jesseax21-Oct-07 17:14
jesseax21-Oct-07 17:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.