FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Syntax for trim charlist?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Syntax for trim charlist? [message #171940 is a reply to message #171935] Sat, 22 January 2011 02:01 Go to previous messageGo to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma:
Senior Member
On 21/01/11 23:35, GarryJones wrote:

> I need to trim away * and # in a list of names.

In a list, or from the start and end of a list.

trim only removes matched characters at the start or end of a string.

eg if you want to convert

"fred * jim ## susan" to "fred jim susan" trim will not work, as the *
and # characters are not at the ends of the string.

This line on the php.net documentation for trim is very important:

"trim — Strip whitespace (or other characters) from the beginning and
end of a string"

Note specifically that it ends "from the beginning and end of a string"

Rgds

Denis McMahon
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Implement Php performace
Next Topic: Is there any situation where anything other than require_once is better?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 03:10:56 GMT 2024

Total time taken to generate the page: 0.05822 seconds