CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: strings

  1. #1
    Join Date
    Mar 2001
    Posts
    29

    strings

    I am reading information from a stored procedure.
    A field that is returned contains either spaces or a string. what i would like to do is if the string contains characters then trim it and if contains just white space then ingnore it. how can i check if the string is just blank spaces?

    Thanks!


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: strings

    trim it and check the length.

    if len(trim(MyString)) = 0 then ' ignore it

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: strings

    Also you must check if it has spaces

    for i = 0 to len(MyString)

    'check here if each char is not a space

    next i

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

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

Featured