Java IntStream中的codePoints()方法
该codePoint()方法用于显示给定序列中的代码点值流。
语法如下
IntStream codePoints()
要使用JavaIntStream类,您需要导入以下包
import java.util.stream.IntStream;
这是我们的弦
String myStr = "Example!";
现在,获取代码点值
IntStream intStream = myStr.codePoints();
以下是codePoints()在JavaIntStream中实现方法的示例
示例
import java.util.stream.IntStream;
public class Demo {
public static void main(String args[]) {
String myStr = "Example!";
IntStream intStream = myStr.codePoints();
System.out.println("The following is the list of ASCII Values for the given string = ");
intStream.forEach(System.out::println);
}
}输出结果
The following is the list of ASCII Values for the given string = 69 120 97 109 112 108 101 33
热门推荐
10 新年门口花束祝福语简短
11 盘锦结婚祝福语大全简短
12 父母生日祝福语 简短独特
13 家庭恩爱祝福语简短英文
14 高考俄语祝福语大全简短
15 虎年祝福语 诗句唯美简短
16 生日婚礼祝福语简短精辟
17 虎年喝酒拜年祝福语简短
18 教师闺蜜祝福语简短