What do you want to save?
Add Code snippet
New code examples
-
C# 2022-01-27 23:25:31
c# break file into words
var text = "'Oh, you can't help that,' said the Cat: 'we're all mad here. I'm mad. You're mad.'"; var punctuation = text.Where(Char.IsPunctuation).Distinct().ToArray(); var words = text.Split().Select(x => x.Trim(punctuation)); Add solution -
Python 2021-11-13 04:48:18
python split clever looping
text = "hello, this is some text to break up, with some reeeeeeeeeaaaaaaally long words." n = 16 words = iter(text.split()) lines, current = [], next(words) for word in words: if len(current) + 1 + len(word) > n: lines.append(cur... Add solution -
Python 2021-10-10 15:33:04
tokenize python
text = “””Here’s to the crazy ones, the misfits, the rebels, the troublemakers, the round pegs in the square holes. The ones who see things differently — they’re not fond of rules. You can quote them, disagree with them... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5