Skip to content

Latest commit

 

History

History
62 lines (54 loc) · 13.6 KB

File metadata and controls

62 lines (54 loc) · 13.6 KB

String

How to reverse each word in a string with vanilla JavaScript 6/5/23
What does (123[‘toString’].length + 123) Print Out in JavaScript? 5/6/23
Getting the index of the last matching item in an array with vanilla JS 6/15
How to trim whitespace from the beginning and end of a string with vanilla JS 6/13
How to add characters to the beginning or end of a string if it's less than a certain length with vanilla JS 6/12
JavaScript Strings: 10 Fundamentals You Should Know 5/20
Template literals and string interpolation in vanilla JS 4/4
Get characters of a string 3/4
5 Secret features of JSON.stringify() 11/26
4 Ways To Append (Concatenate) Strings In JavaScript 11/12
How to replace all instances of a string with another with vanilla JS 9/7
How to replace a section of a string with another one with vanilla JS 9/4
Getting the last matching substring in a string with vanilla JS 4/21
How to remove white space from the beginning or end of a string with vanilla JS 4/9
Repeating a string with vanilla JavaScript 3/30
.charCodeat() The charCodeAt() method returns an integer between 0 and 65535 representing the UTF-16 code unit at the given index.
.codePointAt() The codePointAt() method returns a non-negative integer that is the Unicode code point value.
.includes()
.indexOf()
.join()
.length()
.padStart()
.replace() The replace() method returns a new string with some or all matches of a pattern replaced by a replacement. The pattern can be a string or a RegExp, and the replacement can be a string or a function to be called for each match. If pattern is a string, only the first occurrence will be replaced.
.repeat()
.slice()
.split() The split() method turns a String into an array of strings, by separating the string at each instance of a specified separator string.
.toUpperCase()
.trim() The trim() method removes whitespace from both ends of a string. Whitespace in this context is all the whitespace characters (space, tab, no-break space, etc.) and all the line terminator characters (LF, CR, etc.).
.trimEnd() The trimEnd() method removes whitespace from the end of a string. trimRight() is an alias of this method.
.trimStart() The trimStart() method removes whitespace from the beginning of a string. trimLeft() is an alias of this method.
back slash followed by n, t, 
or quote marks will escape the character

\n //new line
\t //tab

"A newline character is written like \"\\n\"."
“A newline character is written like "\n".

{% code title="Case styles" %}

camelCaseStyle
PascalCaseStyle
snake_case_style
kebab-case-style

Sentence case style
Title Case Style

{% endcode %}