Exercise 4: Prepend a String
Prepend a string to another string.
We'll cover the following...
Problem statement
Skim through the Ruby documentation for strings, and look for a method that prepends one string to another string. Using that method, prepend the first string with the other.
Note: Do not use concatenation to solve this challenge.
Example
string1 = "Machine ", string2 = "Learning"
result = "Machine Learning"
Try it yourself
Press + to interact
def prepend_string(string1, string2)result = ""# Start your code herereturn resultend
to save progress
Exercise 3: Convert String to Float
Exercise 5: Remove Characters from a String
to save progress