Created
November 18, 2013 03:39
-
-
Save thomasballinger/7522081 to your computer and use it in GitHub Desktop.
Three ways to wrap text
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
| >>> wrap('hello there', 5) | |
| ['hello', | |
| 'there'] | |
| >>> wrap('home is where the heartwrenching angst is', 10) | |
| ['home is', | |
| 'where a', | |
| 'heartwrenc', #1 | |
| 'hing', | |
| 'angst is'] | |
| ['home is', | |
| 'where a', | |
| 'heartwrenc', #2 | |
| 'hing angst', | |
| 'is'] | |
| ['home is', | |
| 'where a he', | |
| 'artwrenchi', #3 | |
| 'ng angst', | |
| 'is'] |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Going with #1