3.15.219.217 |    

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.002 seconds at 216.46 KB/s

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

User online
There are 9 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)