当前位置:网站首页>Separate the letters and numbers in the string so that the letters come first and the array comes last
Separate the letters and numbers in the string so that the letters come first and the array comes last
2022-07-01 22:08:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
Big search car school recruitment programming problem :
Separate the letters and numbers in the string and make the letters in the front and the array in the back
public class The school recruit {
static String stringCharFrontNumEnd(String string){
if(string==null ||string.length()==0)
return null;
String charString="";
String numString="";
for(int i=0;i<string.length();i++){
if(string.charAt(i)>='0' && string.charAt(i)<='9')
System.out.println(string.charAt(i));
numString=numString + string.charAt(i);
if(string.charAt(i)>='a' && string.charAt(i)<='z' || string.charAt(i)>='A' && string.charAt(i)<='Z')
charString= charString + string.charAt(i);
}
return charString+numString;
}
public static void main(String[] args) {
String string="h3a2p0p1y";
System.out.println(string + " --> " + stringCharFrontNumEnd(string));
}
}Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/147191.html Link to the original text :https://javaforall.cn
边栏推荐
- 安装mysql时出现:需要这两个包perl(Data::Dumper),perl(JSON)
- MQ学习笔记
- List announced | outstanding intellectual property service team in China in 2021
- C中main函数的几种写法
- 杰理之烧录上层版物料需要【篇】
- What is the difference between consonants and Initials? (difference between initials and consonants)
- 【级联分类器训练参数】Training Haar Cascades
- BC35&BC95 ONENET MQTT(旧)
- 【STM32】STM32CubeMX教程二–基本使用(新建工程点亮LED灯)
- MIT|256KB 内存下的设备上训练
猜你喜欢

mysql 学习笔记-优化之SQL优化

AirServer2022最新版功能介绍及下载

leetcode刷题:栈与队列03(有效的括号)

PMP与NPDP之间的区别是什么?

Do you want to make up for the suspended examination in the first half of the year? Including ten examinations for supervision engineers, architects, etc

Application of real estate management based on 3D GIS

List announced | outstanding intellectual property service team in China in 2021

Go - exe corresponding to related dependency
![[live broadcast review] the first 8 live broadcasts of battle code Pioneer have come to a perfect end. Please look forward to the next one!](/img/27/4bd0de716f5cb360d54f140dc8e9c1.png)
[live broadcast review] the first 8 live broadcasts of battle code Pioneer have come to a perfect end. Please look forward to the next one!
![[deep learning] use deep learning to monitor your girlfriend's wechat chat?](/img/03/ecf50eacc91c0633b0d9689cdad2c2.png)
[deep learning] use deep learning to monitor your girlfriend's wechat chat?
随机推荐
名单揭晓 | 2021年度中国杰出知识产权服务团队
leetcode刷题:栈与队列06(前 K 个高频元素)
leetcode刷题:二叉树02(二叉树的中序遍历)
leetcode刷题:栈与队列01(用栈实现队列)
旁路由设置的正确方式
Unity 使用Sqlite
MQ学习笔记
人才近悦远来,望城区夯实“强省会”智力底座
What is the difference between consonants and Initials? (difference between initials and consonants)
【智能QbD风险评估工具】上海道宁为您带来LeanQbD介绍、试用、教程
Internet of things RFID, etc
上半年暂停考试要补考?包含监理工程师、建筑师等十项考试
Can I choose to open an account for stock trading on flush? Is it safe?
Aidl basic use
【STM32】STM32CubeMX教程二–基本使用(新建工程点亮LED灯)
【直播回顾】战码先锋首期8节直播完美落幕,下期敬请期待!
运放-滞回(迟滞)比较器全流程实战计算
Difference and use between require and import
String类型转换BigDecimal、Date类型
二叉树的基本操作