当前位置:网站首页>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
边栏推荐
猜你喜欢

基于YOLOv5的口罩佩戴检测方法

杰理之、产线装配环节【篇】
![[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!

AirServer2022最新版功能介绍及下载

编程英语生词笔记本

PMP证书真的有用吗?

pytest合集(2)— pytest运行方式

Classify boost libraries by function

名单揭晓 | 2021年度中国杰出知识产权服务团队

Introduction à l'ingénierie logicielle (sixième édition) notes d'examen de Zhang haifan
随机推荐
“丝路正青春 风采看福建”在闽外籍青年短视频大赛火热征集作品中
MQ学习笔记
Talking from mlperf: how to lead the next wave of AI accelerator
旁路由设置的正确方式
leetcode刷题:栈与队列07(滑动窗口最大值)
打出三位数的所有水仙花数「建议收藏」
String类型转换BigDecimal、Date类型
K-means based user portrait clustering model
js数组拼接的四种方法[通俗易懂]
C中main函数的几种写法
辅音和声母的区别?(声母与辅音的区别)
手动实现function isInstanceOf(child,Parent)
人才近悦远来,望城区夯实“强省会”智力底座
功利点没啥!
[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!
[noip2013] building block competition [noip2018] road laying greed / difference
杰理之、产线装配环节【篇】
Case of camera opening by tour
Using closures to switch toggle by clicking a button
LIS (longest ascending subsequence) problem that can be understood [easy to understand]