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 钱包祝福语简短10字
16 送外卖祝福语大全简短
17 周末思念祝福语大全简短
18 发廊元旦祝福语大全简短