标签:kerberos package inpu 定位 let string key 缓冲区 插入
package test; import java.util.*; import javax.security.auth.kerberos.KerberosKey; import java.io.*; import java.math.BigInteger; public class Main { private static final String space_operator = " "; public static void main(String[] args) throws Exception { Scanner scanner = new Scanner(new BufferedInputStream(System.in)); PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)); StringBuffer sb = new StringBuffer(); //StringBuffer是一个缓冲区,开始的时候有16个字节 //append可以添加一些东西放进尾部boolean,int double等 sb.append("ads"); sb.append(4); System.out.println(sb); //在指定位置插入一些东西 sb.insert(1, true); System.out.println(sb); //删除del sb.delete(1, 3); System.out.println(sb); //查找 /* * indexof, * charat * lastindexof等等 */ //替换,不过StringBuffer的替换函数不一样,它能告诉开头结尾替换 sb.replace(1, 3, "臭猪臭猪"); System.out.println(sb); sb.setCharAt(2, ‘s‘); System.out.println(sb); //一些有趣的操作 //设置长度 sb.setLength(10); System.out.println(sb); } }
标签:kerberos package inpu 定位 let string key 缓冲区 插入
原文地址:https://www.cnblogs.com/WINDZLY/p/11788637.html