package com.yanshu.controller;
import java.util.*;
/**
* 替换,json格式,响应时间
* @author Administrator
*
*/
public class Tihuan {
public static void getreplaceAll()
{
System.out.println("如何替换list数组里面的内容");
List list = Arrays.asList("one 123 three Four five six one three Four".split(" "));
System.out.println("List :"+list);
Collections.replaceAll(list, "123", "hundread");
System.out.println("replaceAll: " + list);
}
public static void main(String[] args) {
getreplaceAll();
}
}
import java.util.*;
/**
* 替换,json格式,响应时间
* @author Administrator
*
*/
public class Tihuan {
public static void getreplaceAll()
{
System.out.println("如何替换list数组里面的内容");
List list = Arrays.asList("one 123 three Four five six one three Four".split(" "));
System.out.println("List :"+list);
Collections.replaceAll(list, "123", "hundread");
System.out.println("replaceAll: " + list);
}
public static void main(String[] args) {
getreplaceAll();
}
}