User Tools

Site Tools


uphp:functions:trim

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
uphp:functions:trim [2021/11/12 11:17]
admin created
uphp:functions:trim [2021/11/12 11:21] (current)
admin
Line 25: Line 25:
 Whitespace characters are: Whitespace characters are:
 ^Character^Description^ ^Character^Description^
-  
 |' '|space| |' '|space|
 |'\n'|newline| |'\n'|newline|
-|'\t'| horizontal tab|+|'\t'|horizontal tab|
 |'\v'|vertical tab| |'\v'|vertical tab|
 |'\f'|form feed| |'\f'|form feed|
-|'\r'| Carriage return|+|'\r'|Carriage return|
  
 ====Example==== ====Example====
Line 37: Line 36:
 <code php> <code php>
 <? <?
-  $str="Mary Had A Little Lamb and She LOVED It So"; +  $str="   This had some space.   "; 
-  $str=ucfirst($str); +  $str=trim($str); 
-  print($str); // Prints "Mary had a little lamb and she loved it so"+  print($str); // Prints "This had some space."
 ?> ?>
 </code> </code>
  
-====Note==== 
- 
-This uPHP function is not exactly like the mainline PHP function [[http://php.net/manual/en/function.ucfirst.php|ucfirst]], which does not automatically convert the balance of the string beyond the first character to lowercase. 
  
 ====See Also==== ====See Also====
uphp/functions/trim.1636715854.txt.gz · Last modified: 2021/11/12 11:17 by admin