当前位置:网站首页>切分字符串进行输出显示
切分字符串进行输出显示
2022-08-11 05:12:00 【余谦吖】
字符串“面向对象是以对象为核心…编程思想”,获取并第一个下标和最后一个下标的字符,并输出打印
package Day0712;
import java.util.Scanner;
/**
*字符串“面向对象是以对象为核心..编程思想”,获取并第一个下标和最后一个下标的字符,并输出打印
*/
public class Three {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String say = sc.next();
String[] sp = say.split("");
System.out.println("第一个下标的字符是"+"'"+sp[0]+"'"+",最后一个下标的字符是"+"'"+sp[sp.length -1]+"'");
}
}
边栏推荐
- Project Practice Lecture 27: Application of Status Mode in Duplicate Brands
- [Untitled] 2022 Amination Process Exam Questions Mock Exam Question Bank and Online Mock Exam
- Decryption of BitLocker
- 报表控件Stimulsoft报告中的数据矩阵条形码介绍
- guava RateLimiter均匀限流
- MySQL must know and must know (primary articles)
- ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/data/xxxx
- ARM Architecture 4: Embedded Hardware Platform Interface Development
- 分库分表之sharding-proxy
- Switch and Router Technology-34-Dynamic NAT
猜你喜欢
form form submission database Chinese becomes a question mark
redis集群模式--解决redis单点故障
Unity WebGL RuntimeError: integer overflow
Switch and Router Technology - 32 - Named ACL
Network Skill Tree
Thymeleaf
Switches and routers technology - 24 - configure OSPF single area
Oracle中如何用一个表的数据更新另一个表中的数据_转载
[E-commerce operation] How to formulate a social media marketing strategy?
Core Data 多线程设计
随机推荐
FPGA engineer interview questions collection 121~130
一些常见mysql入门练习
form form submission database Chinese becomes a question mark
Oracle常用语句归纳_持续更新
shell 脚本编程---入门
[E-commerce operation] How to formulate a social media marketing strategy?
BitLocker的解密
项目实战第二十七讲:状态模式在重名品牌中的应用
2022年Android面试中最常问的问题是什么?
Use Adobe genuine software for prostitution to reduce the slow employment and non-employment of fresh graduates
FPGA engineer interview questions collection 111~120
【ARM】rk3399挂载nfs报错
K8s复习笔记7--Redis单机和Redis-cluster的K8S实现
About CC Attacks
Switch and Router Technology-31-Extended ACL
MySQL数据库管理
CentOS7静默安装Oracle11g_转载
实战noVNC全过程操作(包含遇到的问题和解决)
Delphi7 learning record - demo example
redis集群模式--解决redis单点故障