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 春节福字祝福语简短