18.207.255.49 |    

Navigation

Google Advertisement

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

strim
  1. # **************************************************************
  2. # strim -- cut a tring after X chars and append three points
  3. #
  4. #      string strim( string string [, int length ] )
  5.  
  6. function strim () {
  7.  
  8. local string="$1"
  9. local length=${2:-30}
  10. [ "${#string}" -gt ${length} ] && string="${string:0:${length}}..."
  11. echo $string
  12.  
  13. }
Parsed in 0.007 seconds at 45.76 KB/s

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

User online
There are 3 users online.

Tags Cloud

Latest snippets
last day of last month
(Bash::Snippets)
crypt_apr1_md5
(PHP::Function)
crypt_apr1_md5
(Perl::Function)
transparent
(CSS)
rfc2822Toiso8601
(PHP::Function)
STDERR
(Bash::Function)
radius
(CSS)
shadow
(CSS)
rotate
(CSS)
create_function
(JavaScript::Snippets)