|
-
Feb 23rd, 2004, 04:18 PM
#1
Thread Starter
New Member
Fortmat Output
Can someone please help me to format output.
this is what happens.
someone enters a customer name in the
txtcustomername
and i want to be able to format the out put so no matter how it's typed it the output is
John Doe
with the 1st letter of each name capitalized...
please help me... i'm a little lost! thanks!
-
Feb 23rd, 2004, 04:52 PM
#2
i knocked this up for you ...
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MessageBox.Show(ProperCase("john doe"))
End Sub
Private Function ProperCase(ByVal inString As String) As String
Dim strBuffer As String
Dim strItem As String
If Not inString.Length = 0 Then '/// make sure the string isn't empty
If Not inString.IndexOf(" ") = -1 Then '/// if there's spaces / more than one word.
For Each strItem In inString.Split(" ")
strBuffer += strItem.Substring(0, 1).ToUpper & strItem.Substring(1) & " "
Next
Else '/// if it's only one word ( eg: first name )
strBuffer = inString.Substring(0, 1).ToUpper & inString.Substring(1)
End If
End If
Return strBuffer.TrimEnd(" ")
End Function
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Feb 23rd, 2004, 11:28 PM
#3
Frenzied Member
A little off topic
dynamic_sysop: It's not fair that the picture of your cute twins is not updated here but up to date on other forums. I love them, by the way what was their names? Delta Maria and ...?
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Feb 24th, 2004, 11:40 AM
#4
Taylor Madison & Delta Maria are their names Lunatic mate , i'll do an updated picture on here ( the problem is this forum's avator size is limited to a lot smaller than some , so as the twins grow bigger , the pictures lose resolution if made to small )
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|