问答题
本程序将字符串str中的字符'a'用'$'符号代替,然后将字符串中第一个$字符前的所有字符去掉,并打印输出最后的str字符串。
public class exam_64{
public static void main(String[] args) {
String str="Iamagoodboy, andwhataboutyou?";
str=______;
int pos=______;
str=______;
System.out.println(str);
}
}
【正确答案】str.replace('a', '$')
str.indexOf("$")
str.substring (pos)
【答案解析】