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

Application of real estate management based on 3D GIS

Pytest Collection (2) - mode de fonctionnement pytest

人才近悦远来,望城区夯实“强省会”智力底座

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

leetcode刷题:栈与队列05(逆波兰表达式求值)

【智能QbD风险评估工具】上海道宁为您带来LeanQbD介绍、试用、教程

GCC编译

leetcode刷题:二叉树03(二叉树的后序遍历)

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

Why does blocprovider feel similar to provider?
随机推荐
测试撤销1
编程英语生词笔记本
cmake工程化相关
杰理之烧录上层版物料需要【篇】
芭比Q了!新上架的游戏APP,咋分析?
Slf4j打印异常的堆栈信息
I received a letter from CTO inviting me to interview machine learning engineer
旁路由设置的正确方式
burpsuite简单抓包教程[通俗易懂]
杰理之蓝牙耳机品控和生产技巧【篇】
Spark面试题
Wechat applet, continuously playing multiple videos. Synthesize the appearance of a video and customize the video progress bar
【Opencv450】HOG+SVM 与Hog+cascade进行行人检测
String类型转换BigDecimal、Date类型
杰理之、产线装配环节【篇】
Can I choose to open an account for stock trading on flush? Is it safe?
[deep learning] use deep learning to monitor your girlfriend's wechat chat?
Using closures to switch toggle by clicking a button
AirServer手机第三方投屏电脑软件
最近公共祖先(LCA)在线做法