---
# System prepended metadata

title: String Drills

---

# String Drills

## Concat Drill
Make the string "concatenatedPhrase" equal to the string "JavaScript is awesome!" by using the .concat() function.
<iframe height="400px" width="100%" src="https://repl.it/@thinkful/drillOne?lite=true" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-scripts allow-modals"></iframe>


## toLowerCase Drill
Make each variable (lowercaseApples, lowercaseBananas, lowercaseKiwis) equal to the 1st three variables but using the .toLowerCase() method.

<iframe height="400px" width="100%" src="https://repl.it/@thinkful/drillTwo?lite=true" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-scripts allow-modals"></iframe>

## toUpperCase Drill
Make the three empty strings equal to the the first three string variables using the .toUpperCase() method.


<iframe height="400px" width="100%" src="https://repl.it/@thinkful/drillThree?lite=true" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-scripts allow-modals"></iframe>

## Trim Drill
Reassign the values of the strings (helloWorld, robot, candy) to the same string by removing the white space using the .trim() method.

<iframe height="400px" width="100%" src="https://repl.it/@thinkful/drillFour?lite=true" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-scripts allow-modals"></iframe>

## Split Drill
Remove all the spaces of the two strings using the .split() method. Note that using the .split(" ") will replace spaces with commas.

<iframe height="400px" width="100%" src="https://repl.it/@thinkful/drillFive?lite=true" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-scripts allow-modals"></iframe>

## Replace Drill
Change the ending of the string from "Mars" to "World" using the .replace() method. helloMars should be "Hello World" after running.

<iframe height="400px" width="100%" src="https://repl.it/@thinkful/drillSix?lite=true" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-scripts allow-modals"></iframe>

## Using Concat and toLowerCase
Use the .toLowerCase() method on all the variables. Then concatenate them using .concat() and assign that value to the string combinedLower

<iframe height="400px" width="100%" src="https://repl.it/@thinkful/drillSeven?lite=true" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-scripts allow-modals"></iframe>

## Using Replace and toUpperCase
Use the .replace() method to change Sally to Mary. Then use the .toUpperCase() method to capitalize the entire sentence

<iframe height="400px" width="100%" src="https://repl.it/@thinkful/drillEight?lite=true" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-scripts allow-modals"></iframe>

## Using Split and Concat
Use the .split() method to split the entire string at each comma. Then grab the first 5 words & use .concat() to add it to "river"

<iframe height="400px" width="100%" src="https://repl.it/@thinkful/drillNine?lite=true" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-scripts allow-modals"></iframe>

## Using toLowerCase, toUpperCase, and Concat
Use the .split() method to split the entire string at each comma. Then grab the first 5 words & use .concat() to add it to "river"

<iframe height="400px" width="100%" src="https://repl.it/@thinkful/drillTen?lite=true" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-scripts allow-modals"></iframe>