当前位置:网站首页>切分字符串进行输出显示
切分字符串进行输出显示
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]+"'");
}
}
边栏推荐
猜你喜欢

Linux中安装redis

实战noVNC全过程操作(包含遇到的问题和解决)

C Language: Practical Debugging Tips

Idea essential skills to improve work efficiency

Optimization is a kind of habit low starting point is the "standing near the critical"

Oracle中如何用一个表的数据更新另一个表中的数据_转载

Idea提升工作效率的必备技巧

C language antithesis: who is the murderer!

BGP Comprehensive Experiment

Application layer protocol - DNS
随机推荐
redis分布式锁
Optimization is a kind of habit low starting point is the "standing near the critical"
【ARM】rk3399挂载nfs报错
Switch and Router Technology-29-OSPF Virtual Link
HAVE FUN | “SOFA 星球”飞船计划、源码解析活动最新进展
Day38 LeetCode
【无2022上海市安全员A证考试题库及模拟考试
[No 2022 Shanghai Security Officer A Certificate Exam Question Bank and Mock Exam
批量修改数据库等视频文件名称
Switches and routers technologies - 30 - standard acls
面试题整理
Switch and Router Technology-34-Dynamic NAT
You must understand - the nine built-in objects and four domain objects of JSP
How IP-Guard prohibits running U disk programs
Delphi7 learning record - demo example
C language antithesis: who is the murderer!
用白嫖的Adobe正版软件,减少应届毕业生的慢就业、不就业等现象
Redis-数据类型(基本指令、String、List、Set、Hash、ZSet、BitMaps、HyperLogLog、GeoSpatial)/发布和订阅
guava RateLimiter uniform current limit
Switch and Router Technology - 32 - Named ACL