Adding spaces between numbers inside a variable

Hello-

I have a numeric variable "1234567" I need to add a space between each number. Howb can I do that so the output is: "1 2 3 4 5 6 7"

Thanks
jfergyAsked:
Who is Participating?
 
cyberkiwiCommented:
Create the function addspaces as provided below.
Example usage also supplied

<%
function addspaces(s)
dim tmp, i
tmp = Left(s,1)
for i = 2 to Len(s)
tmp = tmp & " " & Mid(s,i,1)
next
addspaces = tmp
end function

dim s
s = "1234567"

response.write addspaces(s)
%>

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.