Guest User

Untitled

a guest
Nov 19th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.65 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta name="String Manipulation" content="[String Manipulation]">
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width">
  7. <title>JS Bin</title>
  8. </head>
  9. <body>
  10. /*
  11. String Manipulation
  12. Do not overthink, string manipulation does exactly what it says. it manipulates strings.
  13. So how do we manipulate strings. We manipulate strings whith what we call methods.
  14.  
  15. // few examples of methods that can be used to manipulate strings //
  16.  
  17. we can concat() which adds a string to another to get a new string
  18. we can use indexOf() which returns your first occurance starting index and -1 if nothing if your value isnt found
  19. we can use charAt() which will return a single character from any string you are looking for
  20. 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
  21. we can use slice()w which adds and removes items to a string(can also add/remove to an array)
  22. we can use toUpperCase() which capitalizes a string
  23. we can use toLowerCase() which makes your string lower case
  24.  
  25. you see where im going? string manipulation is a bunch of methods which manipulates a string.
  26. theres like hundreds of them you can find online so learn your methods and start manipulating.
  27.  
  28. we also have cool lil characters that also manipulates string such as:
  29.  
  30. \t – tab , which tabs a string
  31. \b – backspace/delete, which deletes a string or backspaces
  32. \r – carriage return, sends your line back to the begining
  33. \n – newline, which start a new line within your string
  34.  
  35. */
  36. <script id="jsbin-javascript">
  37. /*
  38. String Manipulation
  39. Do not overthink, string manipulation does exactly what it says. it manipulates strings.
  40. So how do we manipulate strings. We manipulate strings whith what we call methods.
  41.  
  42. // few examples of methods that can be used to manipulate strings //
  43.  
  44. we can concat() which adds a string to another to get a new string
  45. we can use indexOf() which returns your first occurance starting index and -1 if nothing if your value isnt found
  46. we can use charAt() which will return a single character from any string you are looking for
  47. 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
  48. we can use slice()w which adds and removes items to a string(can also add/remove to an array)
  49. we can use toUpperCase() which capitalizes a string
  50. we can use toLowerCase() which makes your string lower case
  51.  
  52. you see where im going? string manipulation is a bunch of methods which manipulates a string.
  53. theres like hundreds of them you can find online so learn your methods and start manipulating.
  54.  
  55. we also have cool lil characters that also manipulates string such as:
  56.  
  57. \t – tab , which tabs a string
  58. \b – backspace/delete, which deletes a string or backspaces
  59. \r – carriage return, sends your line back to the begining
  60. \n – newline, which start a new line within your string
  61.  
  62. */
  63. </script>
  64.  
  65.  
  66.  
  67. <script id="jsbin-source-javascript" type="text/javascript">/*
  68. String Manipulation
  69. Do not overthink, string manipulation does exactly what it says. it manipulates strings.
  70. So how do we manipulate strings. We manipulate strings whith what we call methods.
  71.  
  72. // few examples of methods that can be used to manipulate strings //
  73.  
  74. we can concat() which adds a string to another to get a new string
  75. we can use indexOf() which returns your first occurance starting index and -1 if nothing if your value isnt found
  76. we can use charAt() which will return a single character from any string you are looking for
  77. 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
  78. we can use slice()w which adds and removes items to a string(can also add/remove to an array)
  79. we can use toUpperCase() which capitalizes a string
  80. we can use toLowerCase() which makes your string lower case
  81.  
  82. you see where im going? string manipulation is a bunch of methods which manipulates a string.
  83. theres like hundreds of them you can find online so learn your methods and start manipulating.
  84.  
  85. we also have cool lil characters that also manipulates string such as:
  86.  
  87. \t – tab , which tabs a string
  88. \b – backspace/delete, which deletes a string or backspaces
  89. \r – carriage return, sends your line back to the begining
  90. \n – newline, which start a new line within your string
  91.  
  92. */</script></body>
  93. </html>
Add Comment
Please, Sign In to add comment