User Tools

Site Tools


uphp:functions:trim

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
uphp:functions:trim [2021/11/12 11:18]
admin
uphp:functions:trim [2021/11/12 11:21] (current)
admin
Line 36: 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.1636715892.txt.gz · Last modified: 2021/11/12 11:18 by admin