Results 1 to 6 of 6

Thread: eliminate space and change to lowercase

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2004
    Location
    in the heart of the Mediterranean
    Posts
    1,143

    eliminate space and change to lowercase

    Hi,

    I need to elminate spaces and change text in a textbox to lower. My code is

    VB Code:
    1. If textbox1.text.Trim.ToLower = "myhomepage" then
    2. messagebox.show("correct")

    But it doesnt work. What I actually need is to eliminate whatever every space and put the characters to lower in any text input in textbox.
    any ideas pls...
    Last edited by angelica; Apr 20th, 2006 at 09:10 PM.

  2. #2
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: eliminate space and change to lowercase

    It works fine here, what is the problem exactly?

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2004
    Location
    in the heart of the Mediterranean
    Posts
    1,143

    Re: eliminate space and change to lowercase

    hi,

    I want it to read the accept the string in lowercase and without spaces. How it is doesnt work for me ???

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339

    Re: eliminate space and change to lowercase

    You forgot to remove the spaces:
    VB Code:
    1. If textbox1.text.Replace(" ","").ToLower = "myhomepage" then
    2.      messagebox.show("correct")
    3. End If
    Trim only removes spaces at the start and end of a string.

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2004
    Location
    in the heart of the Mediterranean
    Posts
    1,143

    Re: eliminate space and change to lowercase

    hi Edneeis,

    Many thanks works fine now. Cheers

  6. #6
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,433

    Re: eliminate space and change to lowercase

    Don't forget to resolve your thread from the Thread Tools menu. After 410 posts this courtesy should be automatic.

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