30秒学会 JavaScript 片段 – truncateString
Truncates a string up to a specified length. Determine if the string’s length is greater than ...
Truncates a string up to a specified length. Determine if the string’s length is greater than ...
Converts a given string into an array of words. Use String.prototype.split() with a supplied pattern...
Decapitalizes the first letter of a string. Decapitalizes the first letter of the string and then ad...
Returns a shortened string. Use mb_strlen(), mb_substr() and rtrim() to shorten a string to a give n...
Returns a boolean determining if the passed value is primitive or not. Create an object from val and...
Returns true if the given string is a palindrome, false otherwise. Use String.toLowerCase() to conve...
Replaces all but the last n of characters with the specified mask character. Slice the given string ...
Splits a multiline string into an array of lines. Use String.prototype.split() and a regular express...
Takes any number of iterable objects or objects with a length property and returns the longest one. ...
Checks if a string is an anagram of another string (case-insensitive, ignores spaces, punctuation an...