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 好听的元旦简短祝福语