Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: How to parse a string variable and insert a space after every Uppercase character.


Message #1 by "Jeff McFarland" <jeff@s...> on Thu, 23 May 2002 21:02:02
Hi All,

I'm trying to figure out how to parse a string variable and insert a space 
after every Uppercase character.  For example:  If I have a string 
variable "HelloWorld"... I need a function that will turn that into "Hello 
World".  Any help would be appreciated!

Thanks,

J
Message #2 by Oleg Kapeljushnik <c-oleg.kapeljushnik@w...> on Thu, 23 May 2002 16:16:54 -0400
I think you should be able to do it using regular expression,
I don't remember exact syntax now so I cant give any example.

To make it work you can do something like this

str = Replace(str,"A"," A")
str = Replace(str,"B"," B")
str = Replace(str,"C"," C")
str = Replace(str,"D"," D")
str = Replace(str,"E"," E")

its not most efficient but will do the work in case you stuck.
For more efficient solution you can put all this in the loop
or like I said earlier use Regular Expression.

Hope this will help.

Oleg.

-----Original Message-----
From: Jeff McFarland [mailto:jeff@s...]
Sent: May 23, 2002 5:02 PM
To: ASP Web HowTo
Subject: [asp_web_howto] How to parse a string variable and insert a
space after every Uppercase character.


Hi All,

I'm trying to figure out how to parse a string variable and insert a space
after every Uppercase character.  For example:  If I have a string
variable "HelloWorld"... I need a function that will turn that into "Hello
World".  Any help would be appreciated!

Thanks,

J

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20

Message #3 by "Bailey, Mark" <MBailey@m...> on Thu, 23 May 2002 16:11:41 -0400
something like this:

<%
	Dim i
	Dim char
	Dim ac
	Dim sOut

	Dim teststr 

	teststr = "lalalaLaalaLlalaalaHaaa"

	For i = 2 To Len(teststr)
		char = Mid(teststr,i,1)
		ac = Asc(char)
		If ac > 64 And ac < 91 Then
			sOut = sOut & " " & char
		Else
			sOut = sOut & char
		End If
	Next		
	Response.Write sOut


%>


-----Original Message-----
From: Jeff McFarland [mailto:jeff@s...]
Sent: Thursday, May 23, 2002 5:02 PM
To: ASP Web HowTo
Subject: [asp_web_howto] How to parse a string variable and insert a
space after every Uppercase character.


Hi All,

I'm trying to figure out how to parse a string variable and insert a space 
after every Uppercase character.  For example:  If I have a string 
variable "HelloWorld"... I need a function that will turn that into "Hello 
World".  Any help would be appreciated!

Thanks,

J

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
Message #4 by "Jeff McFarland" <jeff@s...> on Thu, 23 May 2002 21:37:47
WOW... that is really close!  But only one problem.  The output "cuts" off 
the first character.  In your example below... the first "l" is cut off.  
Do you know why?  Other than that thanks so much for your help!  

If you want to completely help solve my problem...  If we could change the 
code below to ignore "a" or "the"?  For example: change (AsktheExpert) to 
(Ask Expert).  This one isn't as important..but it would be nice!

Thanks for the timely response!

L8R,

J

> something like this:

<%
	Dim i
	Dim char
	Dim ac
	Dim sOut

	Dim teststr 

	teststr = "lalalaLaalaLlalaalaHaaa"

	For i = 2 To Len(teststr)
		char = Mid(teststr,i,1)
		ac = Asc(char)
		If ac > 64 And ac < 91 Then
			sOut = sOut & " " & char
		Else
			sOut = sOut & char
		End If
	Next		
	Response.Write sOut


%>


-----Original Message-----
From: Jeff McFarland [mailto:jeff@s...]
Sent: Thursday, May 23, 2002 5:02 PM
To: ASP Web HowTo
Subject: [asp_web_howto] How to parse a string variable and insert a
space after every Uppercase character.


Hi All,

I'm trying to figure out how to parse a string variable and insert a space 
after every Uppercase character.  For example:  If I have a string 
variable "HelloWorld"... I need a function that will turn that into "Hello 
World".  Any help would be appreciated!

Thanks,

J

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
Message #5 by "Jeff McFarland" <jeff@s...> on Thu, 23 May 2002 21:44:15
Ooops... I figured out the first character problem!  

> WOW... that is really close!  But only one problem.  The output "cuts" 
off 
t> he first character.  In your example below... the first "l" is cut 
off.  
D> o you know why?  Other than that thanks so much for your help!  

> If you want to completely help solve my problem...  If we could change 
the 
c> ode below to ignore "a" or "the"?  For example: change (AsktheExpert) 
to 
(> Ask Expert).  This one isn't as important..but it would be nice!

> Thanks for the timely response!

> L8R,

> J

> > something like this:

> <%
	> Dim i
	> Dim char
	> Dim ac
	> Dim sOut

> 	Dim teststr 

> 	teststr = "lalalaLaalaLlalaalaHaaa"

> 	For i = 2 To Len(teststr)
	> 	char = Mid(teststr,i,1)
	> 	ac = Asc(char)
	> 	If ac > 64 And ac < 91 Then
	> 		sOut = sOut & " " & char
	> 	Else
	> 		sOut = sOut & char
	> 	End If
	> Next		
	> Response.Write sOut

> 
%> >

> 
-> ----Original Message-----
F> rom: Jeff McFarland [mailto:jeff@s...]
S> ent: Thursday, May 23, 2002 5:02 PM
T> o: ASP Web HowTo
S> ubject: [asp_web_howto] How to parse a string variable and insert a
s> pace after every Uppercase character.

> 
H> i All,

> I'm trying to figure out how to parse a string variable and insert a 
space 
a> fter every Uppercase character.  For example:  If I have a string 
v> ariable "HelloWorld"... I need a function that will turn that 
into "Hello 
W> orld".  Any help would be appreciated!

> Thanks,

> J

> ---

> Improve your web design skills with these new books from Glasshaus.

> Usable Web Menus
h> ttp://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r> -20
C> onstructing Accessible Web Sites
h> ttp://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r> -20
P> ractical JavaScript for the Usable Web
h> ttp://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r> -20
-> --
C> hange your mail options at 
t> o unsubscribe send a blank email to
%> %email.unsub%%.
Message #6 by Elliott O'Hara <elliotto@e...> on Thu, 23 May 2002 16:49:28 -0400
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C2029B.547D00E0
Content-Type: text/plain


Didn't test it, but this should work...
Try This

Response.Write(Replacer("TestThisThingandThat"),"and"," ")





Function Replacer(str)
Dim i
	Dim char
	Dim ac
	Dim sOut
	For i = 1 To Len(str)
		char = Mid(str,i,1)
		ac = Asc(char)
		If ac > 64 And ac < 91 Then
			sOut = sOut & " " & char
		Else
			sOut = sOut & char
		End If
	Next		
	
Replacer = sOut
End Function 
Thank you,
Elliott O'Hara
Solution Development
ez prints inc


-----Original Message-----
From: Jeff McFarland [mailto:jeff@s...] 
Sent: Thursday, May 23, 2002 5:38 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: How to parse a string variable and insert a s
pace after every Uppercase character.

WOW... that is really close!  But only one problem.  The output "cuts" off 
the first character.  In your example below... the first "l" is cut off.  
Do you know why?  Other than that thanks so much for your help!  

If you want to completely help solve my problem...  If we could change the 
code below to ignore "a" or "the"?  For example: change (AsktheExpert) to 
(Ask Expert).  This one isn't as important..but it would be nice!

Thanks for the timely response!

L8R,

J

> something like this:

<%
	Dim i
	Dim char
	Dim ac
	Dim sOut

	Dim teststr 

	teststr = "lalalaLaalaLlalaalaHaaa"

	For i = 2 To Len(teststr)
		char = Mid(teststr,i,1)
		ac = Asc(char)
		If ac > 64 And ac < 91 Then
			sOut = sOut & " " & char
		Else
			sOut = sOut & char
		End If
	Next		
	Response.Write sOut


%>


-----Original Message-----
From: Jeff McFarland [mailto:jeff@s...]
Sent: Thursday, May 23, 2002 5:02 PM
To: ASP Web HowTo
Subject: [asp_web_howto] How to parse a string variable and insert a
space after every Uppercase character.


Hi All,

I'm trying to figure out how to parse a string variable and insert a space 
after every Uppercase character.  For example:  If I have a string 
variable "HelloWorld"... I need a function that will turn that into "Hello 
World".  Any help would be appreciated!

Thanks,

J

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20

Message #7 by "Alex Shiell, ITS, EB, SE" <alex.shiell@s...> on Fri, 24 May 2002 11:43:20 +0100
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C2030F.D2098FF0
Content-Type: text/plain;
	charset="iso-8859-1"

If your after performance, Oleg's original suggestion was the best one, use
a regular expression
 
Function ReplaceTest(sInput)
 Dim oReg, oMatches, sMatch, sReplace
  
 Set oReg1 = New RegExp  ' Create regular expression to find caps
 Set oReg2 = New RegExp  ' Create another regular expression for the
replacement
 oReg1.Pattern = "[A-Z]"  ' Set pattern.
 oReg1.IgnoreCase = false  ' Make case sensitive.
 oReg1.Global = true  'Make global (so it matches all occurances)
  
 set oMatches = oReg1.Execute(sInput)
 for each sMatch in oMatches
  oReg2.Pattern = sMatch
  sReplace = " " & sMatch
  sInput = oReg2.Replace(sInput, sReplace)
 next  
 
 ReplaceTest = sInput
  
End Function

-----Original Message-----
From: Elliott O'Hara [mailto:elliotto@e...]
Sent: 23 May 2002 21:49
To: ASP Web HowTo
Subject: [asp_web_howto] RE: How to parse a string variable and insert a s
pace after every Uppercase character.




Didn't test it, but this should work... 
Try This 

Response.Write(Replacer("TestThisThingandThat"),"and"," ") 





Function Replacer(str) 
Dim i 
        Dim char 
        Dim ac 
        Dim sOut 
        For i = 1 To Len(str) 
                char = Mid(str,i,1) 
                ac = Asc(char) 
                If ac > 64 And ac < 91 Then 
                        sOut = sOut & " " & char 
                Else 
                        sOut = sOut & char 
                End If 
        Next            
        
Replacer = sOut 
End Function 
Thank you, 
Elliott O'Hara 
Solution Development 
ez prints inc 


-----Original Message----- 
From: Jeff McFarland [ mailto:jeff@s... <mailto:jeff@s...> ] 
Sent: Thursday, May 23, 2002 5:38 PM 
To: ASP Web HowTo 
Subject: [asp_web_howto] RE: How to parse a string variable and insert a s
pace after every Uppercase character. 

WOW... that is really close!  But only one problem.  The output "cuts" off 
the first character.  In your example below... the first "l" is cut off.  
Do you know why?  Other than that thanks so much for your help!  

If you want to completely help solve my problem...  If we could change the 
code below to ignore "a" or "the"?  For example: change (AsktheExpert) to 
(Ask Expert).  This one isn't as important..but it would be nice! 

Thanks for the timely response! 

L8R, 

J 

> something like this: 

<% 
        Dim i 
        Dim char 
        Dim ac 
        Dim sOut 

        Dim teststr 

        teststr = "lalalaLaalaLlalaalaHaaa" 

        For i = 2 To Len(teststr) 
                char = Mid(teststr,i,1) 
                ac = Asc(char) 
                If ac > 64 And ac < 91 Then 
                        sOut = sOut & " " & char 
                Else 
                        sOut = sOut & char 
                End If 
        Next            
        Response.Write sOut 


%> 


-----Original Message----- 
From: Jeff McFarland [ mailto:jeff@s... <mailto:jeff@s...> ] 
Sent: Thursday, May 23, 2002 5:02 PM 
To: ASP Web HowTo 
Subject: [asp_web_howto] How to parse a string variable and insert a 
space after every Uppercase character. 


Hi All, 

I'm trying to figure out how to parse a string variable and insert a space 
after every Uppercase character.  For example:  If I have a string 
variable "HelloWorld"... I need a function that will turn that into "Hello 
World".  Any help would be appreciated! 

Thanks, 

J 

--- 

Improve your web design skills with these new books from Glasshaus. 

Usable Web Menus 
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme>  
r-20 
Constructing Accessible Web Sites 
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme>  
r-20 
Practical JavaScript for the Usable Web 
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme>  
r-20 
--- 
Change your mail options at http://p2p.wrox.com/manager.asp
<http://p2p.wrox.com/manager.asp>  or 

--- 

Improve your web design skills with these new books from Glasshaus. 

Usable Web Menus 
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme>  
r-20 
Constructing Accessible Web Sites 
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme>  
r-20 
Practical JavaScript for the Usable Web 
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme>  
r-20 
--- 
Change your mail options at http://p2p.wrox.com/manager.asp
<http://p2p.wrox.com/manager.asp>  or 

--- Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20 Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20 Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20 --- 


________________________________________________________________________
Scottish Enterprise Network
http://www.scottish-enterprise.com

Headquarters Address & Contact Numbers

150 Broomielaw
5 Atlantic Quay
Glasgow
G2 8LU.
Tel:  +44 (0) 141 248 2700.
Fax:  +44 (0)141 221 3217

 This message is sent in confidence for the addressee only.
It may contain legally privileged information. The contents are not to
be disclosed to anyone other than the addressee. Unauthorised recipients
are requested to preserve this confidentiality and to advise the sender
immediately of any error in transmission.



Message #8 by "Alex Shiell, ITS, EB, SE" <alex.shiell@s...> on Fri, 24 May 2002 11:55:21 +0100
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C20311.801A9BB0
Content-Type: text/plain;
	charset="iso-8859-1"

wee mistake, need to make oReg2 global as well.  Here is the finished
function
 
Function ReplaceTest(sInput)
 Dim oReg, oMatches, sMatch, sReplace
  
 Set oReg1 = New RegExp  ' Create regular expression to find caps
 Set oReg2 = New RegExp  ' Create another regular expression for the
replacement
 oReg1.Pattern = "[A-Z]"  ' Set pattern.
 oReg1.IgnoreCase = false  ' Make case sensitive.
 oReg1.Global = true  'Make global (so it matches all occurances)
  
 set oMatches = oReg1.Execute(sInput)
 for each sMatch in oMatches
  oReg2.Pattern = sMatch
  oReg2.Global = true
  sReplace = " " & sMatch
  sInput = oReg2.Replace(sInput, sReplace)
 next  
 
 ReplaceTest = sInput
  
End Function

-----Original Message-----
From: Alex Shiell, ITS, EB, SE 
Sent: 24 May 2002 11:43
To: ASP Web HowTo
Subject: [asp_web_howto] RE: How to parse a string variable and insert a s
pace after every Uppercase character.


If your after performance, Oleg's original suggestion was the best one, use
a regular expression
 
Function ReplaceTest(sInput)
 Dim oReg, oMatches, sMatch, sReplace
  
 Set oReg1 = New RegExp  ' Create regular expression to find caps
 Set oReg2 = New RegExp  ' Create another regular expression for the
replacement
 oReg1.Pattern = "[A-Z]"  ' Set pattern.
 oReg1.IgnoreCase = false  ' Make case sensitive.
 oReg1.Global = true  'Make global (so it matches all occurances)
  
 set oMatches = oReg1.Execute(sInput)
 for each sMatch in oMatches
  oReg2.Pattern = sMatch
  sReplace = " " & sMatch
  sInput = oReg2.Replace(sInput, sReplace)
 next  
 
 ReplaceTest = sInput
  
End Function

-----Original Message-----
From: Elliott O'Hara [mailto:elliotto@e...]
Sent: 23 May 2002 21:49
To: ASP Web HowTo
Subject: [asp_web_howto] RE: How to parse a string variable and insert a s
pace after every Uppercase character.




Didn't test it, but this should work... 
Try This 

Response.Write(Replacer("TestThisThingandThat"),"and"," ") 





Function Replacer(str) 
Dim i 
        Dim char 
        Dim ac 
        Dim sOut 
        For i = 1 To Len(str) 
                char = Mid(str,i,1) 
                ac = Asc(char) 
                If ac > 64 And ac < 91 Then 
                        sOut = sOut & " " & char 
                Else 
                        sOut = sOut & char 
                End If 
        Next            
        
Replacer = sOut 
End Function 
Thank you, 
Elliott O'Hara 
Solution Development 
ez prints inc 


-----Original Message----- 
From: Jeff McFarland [ mailto:jeff@s... <mailto:jeff@s...> ] 
Sent: Thursday, May 23, 2002 5:38 PM 
To: ASP Web HowTo 
Subject: [asp_web_howto] RE: How to parse a string variable and insert a s
pace after every Uppercase character. 

WOW... that is really close!  But only one problem.  The output "cuts" off 
the first character.  In your example below... the first "l" is cut off.  
Do you know why?  Other than that thanks so much for your help!  

If you want to completely help solve my problem...  If we could change the 
code below to ignore "a" or "the"?  For example: change (AsktheExpert) to 
(Ask Expert).  This one isn't as important..but it would be nice! 

Thanks for the timely response! 

L8R, 

J 

> something like this: 

<% 
        Dim i 
        Dim char 
        Dim ac 
        Dim sOut 

        Dim teststr 

        teststr = "lalalaLaalaLlalaalaHaaa" 

        For i = 2 To Len(teststr) 
                char = Mid(teststr,i,1) 
                ac = Asc(char) 
                If ac > 64 And ac < 91 Then 
                        sOut = sOut & " " & char 
                Else 
                        sOut = sOut & char 
                End If 
        Next            
        Response.Write sOut 


%> 


-----Original Message----- 
From: Jeff McFarland [ mailto:jeff@s... <mailto:jeff@s...> ] 
Sent: Thursday, May 23, 2002 5:02 PM 
To: ASP Web HowTo 
Subject: [asp_web_howto] How to parse a string variable and insert a 
space after every Uppercase character. 


Hi All, 

I'm trying to figure out how to parse a string variable and insert a space 
after every Uppercase character.  For example:  If I have a string 
variable "HelloWorld"... I need a function that will turn that into "Hello 
World".  Any help would be appreciated! 

Thanks, 

J 

--- 

Improve your web design skills with these new books from Glasshaus. 

Usable Web Menus 
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme>  
r-20 
Constructing Accessible Web Sites 
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme>  
r-20 
Practical JavaScript for the Usable Web 
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme>  
r-20 
--- 
Change your mail options at http://p2p.wrox.com/manager.asp
<http://p2p.wrox.com/manager.asp>  or 

--- 

Improve your web design skills with these new books from Glasshaus. 

Usable Web Menus 
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme>  
r-20 
Constructing Accessible Web Sites 
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme>  
r-20 
Practical JavaScript for the Usable Web 
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme>  
r-20 
--- 
Change your mail options at http://p2p.wrox.com/manager.asp
<http://p2p.wrox.com/manager.asp>  or 

--- Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20 Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20 Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20 --- 

--- Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20 Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20 Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20 --- 


________________________________________________________________________

Scottish Enterprise Network

http://www.scottish-enterprise.com


Headquarters Address & Contact Numbers


150 Broomielaw

5 Atlantic Quay

Glasgow

G2 8LU.

Tel: +44 (0) 141 248 2700.

Fax: +44 (0)141 221 3217


This message is sent in confidence for the addressee only.

It may contain legally privileged information. The contents are not to

be disclosed to anyone other than the addressee. Unauthorised recipients

are requested to preserve this confidentiality and to advise the sender

immediately of any error in transmission.




________________________________________________________________________
Scottish Enterprise Network
http://www.scottish-enterprise.com

Headquarters Address & Contact Numbers

150 Broomielaw
5 Atlantic Quay
Glasgow
G2 8LU.
Tel:  +44 (0) 141 248 2700.
Fax:  +44 (0)141 221 3217

 This message is sent in confidence for the addressee only.
It may contain legally privileged information. The contents are not to
be disclosed to anyone other than the addressee. Unauthorised recipients
are requested to preserve this confidentiality and to advise the sender
immediately of any error in transmission.



Message #9 by "Jeff McFarland" <jeff@s...> on Fri, 24 May 2002 14:30:25
Thanks for all your help everyone!
Message #10 by "Jeff McFarland" <jeff@s...> on Fri, 24 May 2002 14:40:59
F.Y.I. This doesn't work.

Later,

Jeff

**********************************************************************

Didn't test it, but this should work...
Try This

Response.Write(Replacer("TestThisThingandThat"),"and"," ")





Function Replacer(str)
Dim i
	Dim char
	Dim ac
	Dim sOut
	For i = 1 To Len(str)
		char = Mid(str,i,1)
		ac = Asc(char)
		If ac > 64 And ac < 91 Then
			sOut = sOut & " " & char
		Else
			sOut = sOut & char
		End If
	Next		
	
Replacer = sOut
End Function 
Thank you,
Elliott O'Hara
Solution Development
ez prints inc

Message #11 by "Nigel" <nigel@m...> on Fri, 24 May 2002 15:05:00 +0100
Thanks everyopne ..

its sorted now .. :)

:: peace ::



-----Original Message-----
From: Jeff McFarland [mailto:jeff@s...]
Sent: 24 May 2002 14:30
To: ASP Web HowTo
Subject: [asp_web_howto] RE: How to parse a string variable and insert a
s pace after every Uppercase character.


Thanks for all your help everyone!

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20

Message #12 by "Jeff McFarland" <jeff@s...> on Fri, 24 May 2002 15:29:46
Well...if anyone has some thoughts about how to ignore words such as "and" 
or "a"... that would still help!

Thx,

J


> Thanks everyopne ..

its sorted now .. :)

:: peace ::


Message #13 by Elliott O'Hara <elliotto@e...> on Fri, 24 May 2002 10:35:15 -0400
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C20330.37E14960
Content-Type: text/plain

Replace(1,TheString,"What To Find", " ")

Thank you,
Elliott O'Hara
Solution Development
ez prints inc


-----Original Message-----
From: Jeff McFarland [mailto:jeff@s...] 
Sent: Friday, May 24, 2002 11:30 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: How to parse a string variable and insert a s
pace after every Uppercase character.

Well...if anyone has some thoughts about how to ignore words such as "and" 
or "a"... that would still help!

Thx,

J


> Thanks everyopne ..

its sorted now .. :)

:: peace ::



---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20

Message #14 by "Jeff McFarland" <jeff@s...> on Fri, 24 May 2002 15:47:20
Could you please paste your entire code?  I'm not sure if I'm doing 
something wrong or your code isn't working as is?

Thx again,

J

*************************************************

Replace(1,TheString,"What To Find", " ")

Thank you,
Elliott O'Hara
Solution Development
ez prints inc


Message #15 by Elliott O'Hara <elliotto@e...> on Fri, 24 May 2002 10:51:20 -0400
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C20332.772867A0
Content-Type: text/plain

Oops... 
Sorry It Should be
Response.Write Replace("ThisandThat","and"," ")

Thank you,
Elliott O'Hara
Solution Development
ez prints inc


-----Original Message-----
From: Jeff McFarland [mailto:jeff@s...] 
Sent: Friday, May 24, 2002 11:47 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: How to parse a string variable and insert a s
pace after every Uppercase character.

Could you please paste your entire code?  I'm not sure if I'm doing 
something wrong or your code isn't working as is?

Thx again,

J

*************************************************

Replace(1,TheString,"What To Find", " ")

Thank you,
Elliott O'Hara
Solution Development
ez prints inc



---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20

Message #16 by "Jeff McFarland" <jeff@s...> on Fri, 24 May 2002 16:00:33
Thanks...that works!  Now one last question:  How would I change the code 
to look for more than one word that I want to ignore?  For example: "and" 
& "the" will be ignored...

Thx,

J

Oops... 
Sorry It Should be
Response.Write Replace("ThisandThat","and"," ")

Thank you,
Elliott O'Hara
Solution Development
ez prints inc


Message #17 by Elliott O'Hara <elliotto@e...> on Fri, 24 May 2002 11:09:20 -0400
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C20334.FB097940
Content-Type: text/plain

Buncha ways come to mind---
I Think this would work pretty nice though (didn't test it though, just off
the top o my head)

Dim strTest
strTest = "Thisandthatthething"

Dim arrWordstoIgnore(3) ' Use the number of words to ignore here
' add all the words you want here

arrWordstoIgnore(0) = "the"
arrWordstoIgnore(1) = "and"


For x = 0 To UBound(arrWordstoIgnore)
	strTest = Replace(strTest, arrWordstoIgnore(x)," ")
Next

Response.Write strTest



Thank you,
Elliott O'Hara
Solution Development
ez prints inc


-----Original Message-----
From: Jeff McFarland [mailto:jeff@s...] 
Sent: Friday, May 24, 2002 12:01 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: How to parse a string variable and insert a s
pace after every Uppercase character.

Thanks...that works!  Now one last question:  How would I change the code 
to look for more than one word that I want to ignore?  For example: "and" 
& "the" will be ignored...

Thx,

J

Oops... 
Sorry It Should be
Response.Write Replace("ThisandThat","and"," ")

Thank you,
Elliott O'Hara
Solution Development
ez prints inc



---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20

Message #18 by "Drew, Ron" <RDrew@B...> on Fri, 24 May 2002 12:19:41 -0400
Response.Write Replacer("TestThisThingandThat")
Works..

-----Original Message-----
From: Jeff McFarland [mailto:jeff@s...]
Sent: Friday, May 24, 2002 10:41 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: How to parse a string variable and insert a
s pace after every Uppercase character.


F.Y.I. This doesn't work.

Later,

Jeff

**********************************************************************

Didn't test it, but this should work...
Try This

Response.Write(Replacer("TestThisThingandThat"),"and"," ")





Function Replacer(str)
Dim i
	Dim char
	Dim ac
	Dim sOut
	For i =3D 1 To Len(str)
		char =3D Mid(str,i,1)
		ac =3D Asc(char)
		If ac > 64 And ac < 91 Then
			sOut =3D sOut & " " & char
		Else
			sOut =3D sOut & char
		End If
	Next	=09
=09
Replacer =3D sOut
End Function
Thank you,
Elliott O'Hara
Solution Development
ez prints inc


---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20

  Return to Index