Write a method that takes two Strings and
and int and returns a String with the second
string inserted into the first one at the index specified by
the int. You can assume that the index is between 0 and the
length of the string, inclusive.
Write a method that takes two Strings and returns
a String consisting of the first String with the
first occurrence of the second String removed.
Write a method that takes two Strings and returns
a String consisting of the first String with all
occurrences of the second String removed.
Write a method that takes a String and
two ints, n and i, and returns
a String consisting of the n characters starting
at position i. You can assume that i is in
bounds and that there are at least n characters left in the
string at that point.
Write a method that takes a String,
an int n, and another String and
returns the n characters from the first String
before the first occurrence of the second String. You can
assume that the second string does occur in the first and that there are
at least n characters before it.
Write a method that takes a String,
an int n, and another String and
returns the n characters from the first String
starting after the first occurrence of the second String. You
can assume that the second string does occur in the first and that there
are at least n characters after it.
Write a method that takes a single String and returns
a boolean indicating whether the String is a
palindrome, that is, is the same backwards as forwards.
Write a method that takes a single String consisting of a
word and returns a String of the original String
translated into Ubbie Dubbie, a gibberish language akin to Pig Latin
formed by the following rule: before each group of vowels insert the
syllable “ub”. So “peanut” would become “pubeanubut”.
Write a method that takes a single String which will contain
a number of runs of repeated letters. Return a String with
each run of letters replaced by the letter and then the length of the run.
For instance "abbccc" would be turned into "a1b2c3".