Very short snippet: cutString()


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. /*
  2. ** @name : cutString()
  3. ** @description : cut a string for n chars
  4. */
  5. protected function cutString(s:String, v:uint = 4):String {
  6. return ( (s.length> v)?s.substr(0,v):s );
  7. }

URL: http://www.undolog.com/2008/06/04/very-short-snippet-cutstring/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.