How to discard the null value inside a string?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • valuedyeng
    New Member
    • Feb 2007
    • 1

    How to discard the null value inside a string?

    Basically I am trying to run a check through a field which allow the use to input their name...
    However I want to make sure they only entered alphabets rather than number
    Can anyone help me out for the code?
    thx
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Originally posted by valuedyeng
    Basically I am trying to run a check through a field which allow the use to input their name...
    However I want to make sure they only entered alphabets rather than number
    Can anyone help me out for the code?
    There are a number of ways you could approach this. One would be to use a Replace statement inside a loop, to zap each numeric digit it finds. Another would be to loop through each character in the string, and if it's not a letter, either remove it or complain to the user.

    There are bound to be other methods.

    Comment

    • hariharanmca
      Top Contributor
      • Dec 2006
      • 1977

      #3
      Originally posted by valuedyeng
      Basically I am trying to run a check through a field which allow the use to input their name...
      However I want to make sure they only entered alphabets rather than number
      Can anyone help me out for the code?
      thx

      you can Block in KeyPress event...So that you can avoid any loop

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Originally posted by hariharanmca
        you can Block in KeyPress event...So that you can avoid any loop
        Good point. Are we dealing with a user interface here, or just a data field?

        Comment

        Working...