Convert to all CAPS

February 6, 2009 on 4:50 pm | In Programming | 2 Comments

To rewrite the users input to capitals.

Dim startcode As String = TextBox1.Text
Dim letters As Char()
Dim counter As Byte = startcode.Length
Dim i As Byte = 0
If startcode <> “” Then
letters = startcode.ToCharArray()
For i = 0 To (counter – 1)
letters(i) = Char.ToUpper(letters(i))
Dim endcode As String = letters
End If


RSS feed for comments on this post. TrackBack URI

  1. Hello 🙂

    ””””””””’ BEGIN SNIPPIT
    ‘ MSDN doc:

    ‘To modify textbox in place:
    SomeTextBox.Text = SomeTextBox.Text.ToUpper()

    ‘To get a brand new string uppercased:

    Dim uppercase as new String(SomeTextBox.Text.ToUpper())
    ””””””””’ END SNIPPIT


    Comment by Billy O'Neal — March 11, 2009 #

  2. Thanks Billy,

    And nice of you to drop by, 🙂 but what I need most of the time is to do only the first letter of a word and then mine is easier to adapt.
    Yours is lots faster if you want to do a whole string, I’m sure.

    Comment by Pieter — March 11, 2009 #

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds. Valid XHTML and CSS. ^Top^