Results 1 to 3 of 3

Thread: Substring

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2001
    Location
    Indiana,PA,USA
    Posts
    217

    Substring

    How to substring a string to specified length?

    dim temp as string

    temp = "Qre60200000"

    I want to display in a message box like this

    6020 0000.(There should be a space inbetween).How to do that/

    Thanks.
    Sudha

  2. #2
    jim mcnamara
    Guest
    Code:
    tmp = "ABCxxxxxxxx"
    temp = mid(temp,4)
    temp = left(temp,4) & " " & mid(temp,5)
    temp is now "xxxx xxxx"

  3. #3
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    tmp = "ABCxxxxxxxx"
    temp = mid(temp,4)
    temp = left(temp,4) & " " & mid(temp,5)

    jim temp = "" check your spelling mister!
    j/k


    temp = "ABCxxxxxxxx"
    temp = mid(temp,4,4) & " " & right(temp,4)

    one less step
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

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