Posted By

pablazo on 01/23/07


String ASP

Versions (?)

acortar cadena

 / Published in: ASP

  1. 'Our function Shorten can accept 2 parameters
  2. 'The string and the length of characters to shorten the string too
  3. Function Shorten(sString, sLength)
  4. 'Make sure length of the string is more than the number of characters to return
  5. If Len (sString) > sLength Then
  6. 'Add four full stops so that the visitor knows the string has been abbreviated
  7. Shorten = Left(sString,sLength) & "..."
  8. Else
  9. 'If the string is shorter than the number of characters allowed then don't shorten
  10. Shorten = sString
  11. End If
  12. End Function

Report this snippet  

You need to login to post a comment.