User Tools

Site Tools


uphp:functions:trim

This is an old revision of the document!


trim

WMMEGA FW >= 2.1170

Remove whitespace from string

Description

string trim ( string $input )

Parameter

$input: A string

Return Values

A string with whitespace characters removed from the beginning and end of the string

Whitespace characters are:

CharacterDescription' 'space
'\n'newline
'\t' horizontal tab
'\v'vertical tab
'\f'form feed
'\r' Carriage return

Example

<?
  $str="Mary Had A Little Lamb and She LOVED It So";
  $str=ucfirst($str);
  print($str); // Prints "Mary had a little lamb and she loved it so"
?>

Note

This uPHP function is not exactly like the mainline PHP function ucfirst, which does not automatically convert the balance of the string beyond the first character to lowercase.

See Also

charat() - Return the ASCII code for a character in a string at an index

strlen() - Return the length of a string

strpos() - Return the position of the first occurrence of a needle in a haystack

strrpos() - Return the position of the last occurrence of a needle in a haystack

strtolower() - Return the lowercase version of a string

strtoupper() - Return the UPPERCASE version of a string

substr() - Return part of a string

uphp/functions/trim.1636715854.txt.gz · Last modified: 2021/11/12 11:17 by admin