How would i go about replacing all instances of a character or string within a string with values from an array?
For example
String testString = "The ? ? was ? his ?";
String[] values = new String[]{"brown", "dog", "eating", "food"};
String needle = "?";
String result = replaceNeedlesWithValues(testString,needle,values);
//result = "The brown dog was eating his food";
method signature
public String replaceNeedlesWithValues(String subject, String needle, String[] values){
//code
return result;
}