Very short snippet: cutString ()

Wednesday, June 4, 2008

Useful and fast! With the values Number of Actionscript, for example, is a vital aid for "print" on video.

Actionscript:
  1. / *
  2. ** @ Name: cutString ()
  3. ** @ Description: cut a string for n chars
  4. * /
  5. s: String , v:uint = 4 ) : String { protected function cutString (s: String, v: UINT = 4): String (
  6. s. length > v ) ?s. substr ( 0 ,v ) :s ) ; return ((s. length> v)? s. substr (0, v): s);
  7. )

Often used in the version sub() _s()

Related Post

Leave a comment

TAG XHTML <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <a <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Use <pre> to enclose code