note 97948 deleted from function.sprintf by visualmind
| From: | visualmind@php.net | Date: | Tue, 18 May 2010 08:14:38 +0000 |
| Subject: | note 97948 deleted from function.sprintf by visualmind | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-169341@lists.php.net to get a copy of this message | ||
Note Submitter: Hellen
----
$s = 'monkey';
printf("[%-10s]\n", $s);
Output: [monkey ]
$s = 'the monkey is in the jungle';
printf("[%-10s]\n", $s);
Output: [the monkey is in the jungle]
But I want the output: [the mokey ]
Can I cut the right characters in the string, and leave the output with 10 characters?
Thanks!