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

用白嫖的Adobe正版软件,减少应届毕业生的慢就业、不就业等现象

Unity WebGL RuntimeError: integer overflow(整数溢出问题)

Unity WebGL RuntimeError: integer overflow

How to switch Green Shield encryption to IP-Guard encryption smoothly

分库分表之sharding-proxy

Switch and Router Technology-35-NAT to PAT

BGP Comprehensive Experiment

网络协议1

Weekly recommended short video: your commonly used Polaroid, its predecessor turned out to be like this!

Switches and routers technology - 26 - configure OSPF peripheral area
随机推荐
C语言:实用调试技巧
【无2022上海市安全员A证考试题库及模拟考试
log4j2漏洞复现以及解决方案
nodes服务器
[No 2022 Shanghai Security Officer A Certificate Exam Question Bank and Mock Exam
Decryption of BitLocker
Redis-使用jedis连接linux中redis服务器失败的解决方案
用白嫖的Adobe正版软件,减少应届毕业生的慢就业、不就业等现象
Configure checkstyle in IDEA
Switch and Router Technology-33-Static NAT
How to read a paper
分库分表之sharding-proxy
4 Module 3: Literature Reading and Research Methods
Application layer protocol - DNS
你务必得明白——JSP的九大内置对象与四大域对象
02.折叠隐藏文字
Tips to make your code more and more taller and taller - code specification, you have to know
K8s Review Notes 7--K8S Implementation of Redis Standalone and Redis-cluster
Optimization is a kind of habit low starting point is the "standing near the critical"
批量修改数据库等视频文件名称