淘先锋技术网

首页 1 2 3 4 5 6 7

package d1;
 
public class o2 {
 
    public static void main(String[] args) {
        String s = "北京欢迎你";
        String[] str = {"北京"};
        String[] str1 = {"你"};
 
        for (int i = 0; i < str.length; i++) {
            if (s.contains(str[i])) {
                s = s.replace(str[i], "郑州");
                s = s.replace(str1[i], "你们");
                System.out.println(s);
            }
        }
    }