当前位置:网站首页>切分字符串进行输出显示
切分字符串进行输出显示
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]+"'");
}
}
边栏推荐
- [No 2022 Shanghai Security Officer A Certificate Exam Question Bank and Mock Exam
- Redis details
- prometheus:(二)监控概述(你永远逃不出我的手掌哈哈)
- ARM Architecture 4: Embedded Hardware Platform Interface Development
- Redis-数据类型(基本指令、String、List、Set、Hash、ZSet、BitMaps、HyperLogLog、GeoSpatial)/发布和订阅
- Difference between @Resource and @Autowired
- 3 Module 2: Use of scientific research tools
- Weekly recommended short video: your commonly used Polaroid, its predecessor turned out to be like this!
- The use of async (asynchronous) and await
- 开发工具篇第七讲:阿里云日志查询与分析
猜你喜欢
Redis-数据类型(基本指令、String、List、Set、Hash、ZSet、BitMaps、HyperLogLog、GeoSpatial)/发布和订阅
shell 脚本编程---入门
C Language: Practical Debugging Tips
C语言题解:谁是凶手!
prometheus:(二)监控概述(你永远逃不出我的手掌哈哈)
宝塔Linux环境下redis开启多端口
Weekly recommended short video: your commonly used Polaroid, its predecessor turned out to be like this!
Network Skill Tree
Prometheus :(一)基本概念
3 Module 2: Use of scientific research tools
随机推荐
The use of async (asynchronous) and await
Day38 LeetCode
JedisLock_Redis分布式锁实现_转载
[Embedded open source library] The use of cJSON, an efficient and streamlined json parsing library
Tips to improve your productivity, you have to know - Navitcat shortcuts
面试题整理
Switch and Router Technology-31-Extended ACL
MySQL数据库管理
C Language: Practical Debugging Tips
代码在线审查(添加网页批注)的实现
Sub-database sub-table ShardingSphere-JDBC notes arrangement
MFC 进程间通信(共享内存)
Oracle常用语句归纳_持续更新
MyEclipse数据库工具使用教程:使用驱动程序
关于ie下href有中文出现RFC 7230 and RFC 3986问题的研究
Prometheus :(一)基本概念
[No 2022 Shanghai Security Officer A Certificate Exam Question Bank and Mock Exam
什么是三次握手和四次挥手(清晰易懂)
Golden Warehouse Database KingbaseGIS User Manual (6.8. Geometry Object Input Function)
【无2022上海市安全员A证考试题库及模拟考试