February 01, 2003 9:50 PM
Subject: RE: [PHP-WIN] Something like trim()
> Or just
>
> $cleanstring = ereg_replace("[ \t\n]+"," ",trim($dirtystring));
>
> Jill
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
t" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 01, 2003 1:58 AM
Subject: Re: [PHP-WIN] Something like trim()
> is there no more complicated solution for this? ;-)
>
> nothing for bad!
>
> B.A.T. Svensson wrote:
> > Something like (
Or just
$cleanstring = ereg_replace("[ \t\n]+"," ",trim($dirtystring));
Jill
-Original Message-
From: Cam Dunstan [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 01, 2003 2:24 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Something like trim()
Cybot, try this
function
is there no more complicated solution for this? ;-)
nothing for bad!
B.A.T. Svensson wrote:
Something like (not tested and compiled - please find the bugs :))
will remove white space dups:
char *TrimInString(char *pzWashMe)
{
if (!pzWashMe) return NULL;
register char *pzMarker = pzWashMe;
check out str_replace()- you`ll find it in the "string functions"
section of the manual.
- Original Message -
From: "Bobo Wieland" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 30, 2003 6:26 PM
Subject: [PHP-WIN] Something like trim()
> Is there an easy way t
I'll answering it myself so that no one else has to bother;
$str = ereg_replace("[[:space:]]+", " ", trim($str));
. bobo
- Original Message -
From: "Bobo Wieland" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 30, 2003 8:26 AM
Subject: [PHP-WIN] Something like trim(
Something like (not tested and compiled - please find the bugs :))
will remove white space dups:
char *TrimInString(char *pzWashMe)
{
if (!pzWashMe) return NULL;
register char *pzMarker = pzWashMe;
bool bStillTrimingString = false;
while (StrReplacee("\t", " ", pzMarkerrReplacee("\n", "