54.152.216.170 |    

Navigation

Google Advertisement

Diese Funktion kürzt ein String nach N (default 30) Zeichen und hängt drei Punkte am Ende des String an.

strim
  1. # **************************************************************
  2. # strim -- cut a string after X chars and append three points
  3. #
  4. #     string strim( string string [, int length ] )
  5.  
  6. sub strim {
  7.  
  8. my ( $string, $length ) = @_;
  9. $length = 30 if !$length;
  10. substr( $string, $length ) = '...' if ( length( $string ) > $length );
  11. return $string;
  12.  
  13. }
Parsed in 0.001 seconds at 274.10 KB/s

Search
 
Full text search by name and content of a snippet.

User online
There are 4 users online.

Tags Cloud

Latest snippets
str2seconds
(Bash::Function)
is_integer
(Bash::Function)
file_rotate
(Bash::Function)
confirm
(Bash::Function)
is_workingtime
(Bash::Function)
last day of last month
(Bash::Snippets)
crypt_apr1_md5
(PHP::Function)
crypt_apr1_md5
(Perl::Function)
transparent
(CSS)
rfc2822Toiso8601
(PHP::Function)