Insert hyphen INTO MY STRING

Posted on 2012-03-16
Last Modified: 2012-03-21

I have a string with


but what I want is this


with hyphen

Question by:lulu50
LVL 18

Accepted Solution

nap0leon earned 500 total points
Comment Utility
This ought to give you a feel for how to do it.

position1 = 8
position2 = 12
position3 = 16
position4 = 20

newStr = Left(str,position1) & "-" & Mid(str,position1+1,4) & "-" & Mid(str,position2+1,4) & "-" & Mid(str,position3+1,4) & "-" & Mid(str,position4+1)

response.write(desired & "<br/>")


Open in new window


Author Closing Comment

Comment Utility
Thank you

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Syntax Help on SP 4 52
Classic ASP - x-editable save to SQL 3 62
Adding Datediff to staistics page 2 33
Copy only dates 3 69
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: and…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now