KandZ – Tuts

We like to help…!

JavaScript 22 ๐Ÿงฌ string methods

a - string properties part 1
fromCharCode(...) โ†’ returns string from char codes
charAt(index) โ†’ returns the character at the specified index
charCodeAt(index) โ†’ returns the Unicode of the character at the specified index.
toString() โ†’ Converts a string object back to a primitive string
valueOf() โ†’ returns the primitive value of a string object.
toUpperCase() โ†’ converts all characters to uppercase.
toLowerCase() โ†’ converts all characters to lowercase.
concat(...values) โ†’ joins two or more strings and returns the new concatenated string.
+ Operator โ†’ also used to concatenate strings

b - string properties part 2
slice(startIndex, endIndex) โ†’ extracts a section of a string and returns it as a new string.
substring(startIndex, endIndex) โ†’ similar to slice, but doesn't handle negative indices the same way
substr(startIndex, length) โ†’ extracts a specified number of characters from a string, starting at the provided index
indexOf(searchValue, fromIndex) โ†’ returns the position of the first occurrence of a specified value.
lastIndexOf(searchValue, fromIndex) โ†’ returns the position of the last occurrence of a specified value
includes(searchValue, start) โ†’ checks if a string contains a specified substring
replace(searchValue, newValue) โ†’ replaces the first match of a specified value with another value.
split(separator, limit) โ†’ splits a string into an array of substrings based on a separator

c - string properties part 3
trim() โ†’ removes whitespace from both ends of a string.
trimStart() โ†’ removes whitespace from the start of a string (ES2019)
trimEnd() โ†’ removes whitespace from the end of a string (ES2019).
padStart(targetLength, padString) โ†’ pads the start of a string with another string to reach a specified length
padEnd(targetLength, padString) โ†’ pads the end of a string with another string to reach a specified length.
match(regexp) โ†’ searches a string for a match against a regular expression
search(regexp) โ†’ tests for a match in a string and returns the index of the match or -1 if not found.
repeat(count) โ†’ returns a new string with a specified number of copies of the original string.

Stop using slow, ad-bloated tool sites! ๐Ÿคฎ

๐Ÿ”Ž Search “KandZ Tools” on Google to use many professional utilities for free.

KandZ.me is the ultimate minimalist hub for:
โœ… Finance (Mortgage, Interest, Inflation)
โœ… Tech (Base64, JSON, Dev Suite, IP)
โœ… Health (BMI, BMR, TDEE)
โœ… Productivity (Timer, Workspace, QR)

โšก๏ธ Fast & Private
๐Ÿ”’ No data leaves your device
๐Ÿ’Ž 100% Free

๐Ÿ”— Use it now: https://tools.kandz.me
๐Ÿ”– Bookmark itโ€”youโ€™ll need it later!

Leave a Reply

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Powered By
100% Free SEO Tools - Tool Kits PRO