Search Results

Searching for: String

Individual Exercises

0 / 50

Write a function in Java that implements the following logic: Given a string name, e.g. "Bob", return a greeting of the form "Hello...

0 / 50

Write a function in Java that implements the following logic: Given a string, if the string begins with "red" or "blue" return that color...

0 / 50

Write a function in Java that implements the following logic: Given a string and an int n, return a string made of n repetitions of the...

0 / 50

Given a string of even length, return the first half. So the string "WooHoo" yields "Woo".

0 / 50

Given a string str and an int n, return a string made of the first n characters of the string, followed by the first n - 1 characters of...

0 / 30

Given a string, return true if "bad" appears starting at index 0 or 1 in the string, such as with "badxxx" or "xbadxx" but not "xxbadxx"....

0 / 50

Return a version of the given string, where for every star (*) in the string the star and the character immediately to its left and the...

0 / 30

Given a string, return a new string made of 3 copies of the last 2 chars of the original string. The string's length will be at least 2.

...