Thread: string trouble
View Single Post
Old 08-02-2002, 12:21 PM   PM User | #1
Pompiuses
Regular Coder

 
Join Date: Jun 2002
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Pompiuses is an unknown quantity at this point
string trouble

I have this string:

$old_text = "ert, ert,ert,ert,ert";

Sometimes there is a space behind the comma, sometimes it's not. How can I test if there is a space behind a comma, and if it is'nt put a space behind it?

So that $old_text prints:
ert, ert, ert, ert, ert

Something like this:

Search through the string $old_text, and test
if(there is space behind a comma)
{do nothing}
else
{insert a space behind the comma}
Pompiuses is offline   Reply With Quote