Skip to content

Instantly share code, notes, and snippets.

@gronnbeck
Created August 23, 2012 12:49
Show Gist options
  • Save gronnbeck/3436325 to your computer and use it in GitHub Desktop.
Save gronnbeck/3436325 to your computer and use it in GitHub Desktop.
old_string = "fuckdsfsf dsknsfsd kjh jkh jkh jkh gf"
new_string = []
count = 0
words = 0
last = 0
for a in old_string.split(" "):
words = words + 1
if (count + len(a) > 80): continue
new_string.append("".join(a[last, words]))
last = words
count = 0
"\\".join(new_string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment