Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta name="String Manipulation" content="[String Manipulation]">
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width">
- <title>JS Bin</title>
- </head>
- <body>
- /*
- String Manipulation
- Do not overthink, string manipulation does exactly what it says. it manipulates strings.
- So how do we manipulate strings. We manipulate strings whith what we call methods.
- // few examples of methods that can be used to manipulate strings //
- we can concat() which adds a string to another to get a new string
- we can use indexOf() which returns your first occurance starting index and -1 if nothing if your value isnt found
- we can use charAt() which will return a single character from any string you are looking for
- we can use lastIndexOf which is the opposite of indexOf() which will return your last occurence of your index and - 1 if your value isnt found
- we can use slice()w which adds and removes items to a string(can also add/remove to an array)
- we can use toUpperCase() which capitalizes a string
- we can use toLowerCase() which makes your string lower case
- you see where im going? string manipulation is a bunch of methods which manipulates a string.
- theres like hundreds of them you can find online so learn your methods and start manipulating.
- we also have cool lil characters that also manipulates string such as:
- \t – tab , which tabs a string
- \b – backspace/delete, which deletes a string or backspaces
- \r – carriage return, sends your line back to the begining
- \n – newline, which start a new line within your string
- */
- <script id="jsbin-javascript">
- /*
- String Manipulation
- Do not overthink, string manipulation does exactly what it says. it manipulates strings.
- So how do we manipulate strings. We manipulate strings whith what we call methods.
- // few examples of methods that can be used to manipulate strings //
- we can concat() which adds a string to another to get a new string
- we can use indexOf() which returns your first occurance starting index and -1 if nothing if your value isnt found
- we can use charAt() which will return a single character from any string you are looking for
- we can use lastIndexOf which is the opposite of indexOf() which will return your last occurence of your index and - 1 if your value isnt found
- we can use slice()w which adds and removes items to a string(can also add/remove to an array)
- we can use toUpperCase() which capitalizes a string
- we can use toLowerCase() which makes your string lower case
- you see where im going? string manipulation is a bunch of methods which manipulates a string.
- theres like hundreds of them you can find online so learn your methods and start manipulating.
- we also have cool lil characters that also manipulates string such as:
- \t – tab , which tabs a string
- \b – backspace/delete, which deletes a string or backspaces
- \r – carriage return, sends your line back to the begining
- \n – newline, which start a new line within your string
- */
- </script>
- <script id="jsbin-source-javascript" type="text/javascript">/*
- String Manipulation
- Do not overthink, string manipulation does exactly what it says. it manipulates strings.
- So how do we manipulate strings. We manipulate strings whith what we call methods.
- // few examples of methods that can be used to manipulate strings //
- we can concat() which adds a string to another to get a new string
- we can use indexOf() which returns your first occurance starting index and -1 if nothing if your value isnt found
- we can use charAt() which will return a single character from any string you are looking for
- we can use lastIndexOf which is the opposite of indexOf() which will return your last occurence of your index and - 1 if your value isnt found
- we can use slice()w which adds and removes items to a string(can also add/remove to an array)
- we can use toUpperCase() which capitalizes a string
- we can use toLowerCase() which makes your string lower case
- you see where im going? string manipulation is a bunch of methods which manipulates a string.
- theres like hundreds of them you can find online so learn your methods and start manipulating.
- we also have cool lil characters that also manipulates string such as:
- \t – tab , which tabs a string
- \b – backspace/delete, which deletes a string or backspaces
- \r – carriage return, sends your line back to the begining
- \n – newline, which start a new line within your string
- */</script></body>
- </html>
Add Comment
Please, Sign In to add comment