• java字符串根据空格截取并存进ArrayList,并在每个元素前后加上/


    public class List {
    public static void main(String[] args) {
    String s = "abc nnn ooo/xzsxc bs";
    System.out.println("原字符串:"+s);
    System.out.println();
    String a[] = s.split(" ");
    ArrayList b = new ArrayList();
    for (int i = 0; i < a.length;i++){
    b.add(a[i]);
    System.out.println(a[i]);
    }
    System.out.println();
    for( int i=0;i<a.length;i++ ){
    a[i] = a[i].replaceAll(a[i],"/"+ a[i] + "/");
    System.out.println(a[i]);
    }
    }
    }
  • 相关阅读:
    31
    30
    29
    28
    27
    26
    25
    23
    cesium 基础
    操作SDO_GEOMETRY字段
  • 原文地址:https://www.cnblogs.com/THEONLYLOVE/p/9114908.html
Copyright © 2020-2023  润新知