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 -
Javascript 2021-10-11 21:00:03
javascript string prototype
/* String prototype all built-in methods: * developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String * ------------------------------------------------------------------------- */ // Example for *extending* the String prototype String... Add solution -
Javascript 2021-09-20 20:44:03
string reduction javascript
// method to extend String to call reduce the same way as an Array String.prototype.reduce = function () { return this.split().reduce(...arguments); } // sum of the ascii codes using the newly created String prototype method str.reduce((a,b) => a... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5