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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add spaces in front of capital letters 1

Status
Not open for further replies.

SBpsc

MIS
Dec 1, 2004
50
CA
Can someone help me with the following?

Using CR 10. I need to be able to split a word based on the capital letters in it.

For example, I have the word "TheSessionForTodayIs".

I need to put a space in front of every capital letter so as to display it as "The Session For Today Is"

Any ideas?

Thanks in advance.
 
try this, it may not be the best solution, but it works
(replace text with your database field):


stringVar strInput := "TheSessionForTodayIs";
numberVar i;
stringVar strOutput;

strOutput := strInput[1];

for i := 2 to len(strInput) do
(
if asc(strInput) = asc(ucase(strInput)) then
strOutput := strOutput & " " & strInput
else
strOutput := strOutput & strInput
);

strOutput;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top