//用内存,将小写字母替换成大写字母
		String str = "helloworld,goodmorning";
		ByteArrayOutputStream bos = null;
		ByteArrayInputStream bis = null;
		bis = new ByteArrayInputStream(str.getBytes());
		bos = new ByteArrayOutputStream();
		int temp = -1;
		while( (temp = bis.read()) != -1 ) //依次读取内存
		{
                         //接收字符
			char c = (char) temp;
			bos.write(Character.toUpperCase(c)); //输出
		}
		//取出内存中的内容
		String newStr = bos.toString();
		System.out.println(newStr);                                    

  

相关文章:

  • 2021-09-13
  • 2022-01-26
  • 2021-06-09
  • 2022-02-04
  • 2022-12-23
  • 2021-09-19
  • 2021-06-06
  • 2022-12-23
猜你喜欢
  • 2021-06-24
  • 2022-12-23
  • 2022-12-23
  • 2021-08-01
  • 2022-01-27
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案