Results 1 to 4 of 4

Thread: Fortmat Output

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2004
    Posts
    1

    Question 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!

  2. #2
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    i knocked this up for you ...
    VB Code:
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.         MessageBox.Show(ProperCase("john doe"))
    3.     End Sub
    4.  
    5.     Private Function ProperCase(ByVal inString As String) As String
    6.         Dim strBuffer As String
    7.         Dim strItem As String
    8.  
    9.         If Not inString.Length = 0 Then '/// make sure the string isn't empty
    10.             If Not inString.IndexOf(" ") = -1 Then '/// if there's spaces / more than one word.
    11.                 For Each strItem In inString.Split(" ")
    12.                     strBuffer += strItem.Substring(0, 1).ToUpper & strItem.Substring(1) & " "
    13.                 Next
    14.             Else '/// if it's only one word ( eg: first name )
    15.                 strBuffer = inString.Substring(0, 1).ToUpper & inString.Substring(1)
    16.             End If
    17.         End If
    18.  
    19.         Return strBuffer.TrimEnd(" ")
    20.  
    21.     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]

  3. #3
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474

    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

  4. #4
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    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
  •  



Click Here to Expand Forum to Full Width