Results 1 to 3 of 3

Thread: Extract the first 6 characters of a string

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2001
    Posts
    1,384

    Extract the first 6 characters of a string

    How can I extract the first 6 characters of a string?

    e.g.
    str1 = "abcdefghijklmnopqrstu"

    =>str2 = "abcdef"
    Mel

  2. #2
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    Code:
    str2 = Left(str1,6)

  3. #3
    Fanatic Member riis's Avatar
    Join Date
    Nov 2001
    Posts
    551
    If performance will become an issue one day, you can better use Left$(str1,6). This will return a string value, while the Left function returns a variant value, which is converted to a string afterwards.

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