2018年3月24日
30秒学会 JavaScript 片段 – escapeHTML
Escapes a string for use in HTML. Use String.prototype.replace() with a regexp that matches the char...
Escapes a string for use in HTML. Use String.prototype.replace() with a regexp that matches the char...
Converts a given string into an array of words. Use String.prototype.split() with a supplied pattern...
Checks if a string is an anagram of another string (case-insensitive, ignores spaces, punctuation an...
Calculates the Hamming distance between two values. Use the XOR operator (^) to find the bit differe...
Returns a string with whitespaces compacted. Use Regexp.ReplaceAllString() with a regular expression...
Converts a string to camel case. Use Regex.Matches() with an appropriate regular expression to break...
Returns number of vowels in the provided string. Use a regular expression to count the number of vow...