Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Regular Expressions - Inserting space character into text string.

Status
Not open for further replies.

alfie002

Technical User
Mar 3, 2004
121
0
0
GB
Dear all, I should be able to sort this one out but I cannot see it at the moment. I have a string such as;

1234->5678

I want to be able to insert a white space before and after the arrowhead as follows;

1234 -> 5678

I would appreciate it if anyone could drop me a clue.

Thanks and regards.

Alf.
 
newstr=gsub(/->/," -> ",oldstr)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top