当前位置:网站首页>判断一个字符串是否为空,如果为空,对其赋值,如果不为空,获取字符的个数并打印第一个字符
判断一个字符串是否为空,如果为空,对其赋值,如果不为空,获取字符的个数并打印第一个字符
2022-08-11 05:12:00 【余谦吖】
判断一个字符串是否为空,如果为空,对其赋值,如果不为空,获取字符的个数并打印第一个字符
package Day0712;
import java.util.Scanner;
/**
* 判断一个字符串是否为空,如果为空,对其赋值,如果不为空,获取字符的个数并打印第一个字符
*/
public class Five {
public static void main(String[] args) {
String say = "";
if (say.length() > 0){
int to = say.charAt(0);
System.out.println("字符的个数"+say.length()+"并打印第一个字符"+to);
}else {
say = "qqq";
System.out.println(say);
}
}
}
边栏推荐
- [QNX Hypervisor 2.2用户手册]10.15 vdev timer8254
- 2022 coal mine gas inspection test, simulation test question and answer
- Mysql入门练习
- How to use svg-icon (svg-sprite-loader plugin)
- ARM Architecture 4: Embedded Hardware Platform Interface Development
- 你务必得明白——JSP的九大内置对象与四大域对象
- 批量修改数据库等视频文件名称
- IDEA模板总结
- Switch and Router Technology - 25 - OSPF Multi-Area Configuration
- 3 Module 2: Use of scientific research tools
猜你喜欢

玩转mysql之查看mysql版本号

Switches and routers technology - 26 - configure OSPF peripheral area

Core Data 多线程设计

Switches and routers technology - 24 - configure OSPF single area

C language antithesis: who is the murderer!

Switch and Router Technology-29-OSPF Virtual Link

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

IP-Guard如何禁止运行U盘程序

Switches and routers technology - 21 - RIP routing protocol

IDEA中配置checkstyle
随机推荐
MySQL存储引擎概念
你务必得明白——JSP的九大内置对象与四大域对象
C statement: data storage
MySQL must know and must know (primary articles)
Sub-database sub-table ShardingSphere-JDBC notes arrangement
BGP Comprehensive Experiment
普林斯顿微积分读本05第四章--求解多项式的极限问题
[QNX Hypervisor 2.2用户手册]10.16 vdev virtio-blk
redis分布式锁
IP-Guard如何禁止运行U盘程序
Unity WebGL RuntimeError: integer overflow
2022 coal mine gas inspection test, simulation test question and answer
[Untitled] 2022 Amination Process Exam Questions Mock Exam Question Bank and Online Mock Exam
Oracle中如何用一个表的数据更新另一个表中的数据_转载
四大函数式接口
Switch and Router Technology-27-OSPF Route Redistribution
Zabbix builds enterprise-level monitoring and alarm platform
HAVE FUN | "SOFA Planet" spacecraft plan, the latest progress of source code analysis activities
[Embedded open source library] The use of MultiButton, an easy-to-use event-driven button driver module
批量修改数据库等视频文件名称