Created
March 19, 2014 01:01
-
-
Save athap/9633491 to your computer and use it in GitHub Desktop.
Truncate text in Ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MaxLength = N | |
valid_string = some_long_text[0,N] if some_long_text.length > N |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment