locked
Capitalize a string

    Question

  • I want to ask if is there any way to capitalize an entire string, so that a string looking like

    QweRtY

    can be automatically changed into

    QWERTY

    Thanks a lot!!
    Wednesday, January 10, 2007 10:06 AM

Answers

  • http://msdn2.microsoft.com/en-us/library/53e2ew8a.aspx

    Seems like next time i should searcha  bit more before posting...

    Thanks anyway ;)
    Wednesday, January 10, 2007 11:24 AM

All replies

  • http://msdn2.microsoft.com/en-us/library/53e2ew8a.aspx

    Seems like next time i should searcha  bit more before posting...

    Thanks anyway ;)
    Wednesday, January 10, 2007 11:24 AM
  • Actually, what i need now is a function that can change characters like

    á é í ó ú

    into

    a e i o u

    Thanks and sorry for posting so many replyes :P
    Wednesday, January 10, 2007 11:37 AM
  • The method below should cater for this, the sourceString can be either single characters or complete strings.

    Public Function convertCharacters(ByVal sourceString As String) As String

    Dim resultString As String = ""

    resultString = sourceString.Replace("á", "a")

    resultString = sourceString.Replace("é", "e")

    resultString = sourceString.Replace("í", "i")

    resultString = sourceString.Replace("ó", "o")

    resultString = sourceString.Replace("ú", "u")

    Return resultString

    End Function

    Hope this help!

     

     

    Friday, January 12, 2007 3:37 PM
  • There's a couple of ways to skin this one,

     

    Dim source As String

    Dim target As String

    target = UCase(source)

    target = source.ToUpper (+1 overload)

    Friday, January 12, 2007 3:48 PM