dcsimg
Results 1 to 3 of 3

Thread: [RESOLVED] String length

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2013
    Location
    San Francisco, CA
    Posts
    253

    Resolved [RESOLVED] String length

    I have defined a string variable:

    Code:
    Dim strSearchText as String
    strSearchText = "Aug‎ ‎16‎, ‎2016"
    I thought the length of this variable would be 12 characters but when I type "Len(strSearchText)" in the Immediate window it shows the length to be 16 characters.

    What am I missing?

  2. #2
    Frenzied Member
    Join Date
    Jul 2006
    Location
    MI
    Posts
    1,849

    Re: String length

    Looks like you have some hidden characters in your string. When I copied your string from this post it said the length was 16. If I retype the string it says 12. If you put your cursor right before the first character of the string (in the VS editor) & press the right arrow key you will see where the hidden characters are.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2013
    Location
    San Francisco, CA
    Posts
    253

    Re: String length

    Thanks, you're right. I copied/pasted the value ("Aug 16, 2016") from a webpage. The page must have included hidden characters. Thanks for your help and quick reply to my post

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width