社区
Java SE
帖子详情
求助,int型数组怎么转化成字符串啊?
wo327808864
2010-03-18 10:21:05
求助,int型数组怎么转化成字符串啊?
...全文
322
8
打赏
收藏
求助,int型数组怎么转化成字符串啊?
求助,int型数组怎么转化成字符串啊?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
8 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
machao299
2010-03-18
打赏
举报
回复
[Quote=引用 5 楼 knightzhuwei 的回复:]
Arrays.toString(int[] i)
[/Quote]
多方便、
Dazzlingwinter
2010-03-18
打赏
举报
回复
Arrays数组工具类有对应的方法咯,比较好用了
我没运行,前面有循环了,里面的++去掉就好了
for(int i: a) {
strBuff.append(a[i]);
}
wo327808864
2010-03-18
打赏
举报
回复
[Quote=引用 4 楼 wo327808864 的回复:]
引用 1 楼 dazzlingwinter 的回复:
1.int[] a = new int[]{1,2,3,4,5,6};
StringBuffer strBuff = new StringBuff();
for(int i: a) {
strBuff.append(a[i++]);
}
return strBuff.toString();
2.
将int数组转为字符数组
ch……
[/Quote]
int[] a = new int[]{1,2,3,4,5,6};
StringBuffer strBuff = new StringBuff();
for(int i: a) {
strBuff.append(a[i++]);
}
return strBuff.toString();
应该是strBuff.append(a[--i])吧
knightzhuwei
2010-03-18
打赏
举报
回复
Arrays.toString(int[] i)
wo327808864
2010-03-18
打赏
举报
回复
[Quote=引用 1 楼 dazzlingwinter 的回复:]
1.int[] a = new int[]{1,2,3,4,5,6};
StringBuffer strBuff = new StringBuff();
for(int i: a) {
strBuff.append(a[i++]);
}
return strBuff.toString();
2.
将int数组转为字符数组
char[] c = int[] a;//伪代码咯
ret……
[/Quote]
问下有API的方法直接转的没?没的话就结贴了
lhlove271015
2010-03-18
打赏
举报
回复
2楼的正解
lhlove271015
2010-03-18
打赏
举报
回复
楼主是要把int型数组转化为字符串数组吗?
Dazzlingwinter
2010-03-18
打赏
举报
回复
1.int[] a = new int[]{1,2,3,4,5,6};
StringBuffer strBuff = new StringBuff();
for(int i: a) {
strBuff.append(a[i++]);
}
return strBuff.toString();
2.
将int数组转为字符数组
char[] c = int[] a;//伪代码咯
return new String(c);
字符串
指针与char
型
指针
数组
本文深入解析了
字符串
指针、char
型
指针
数组
的概念及其使用方法,并对比了
int
型
和char
型
数组
的
数组
名与取地址的区别。
【C】C语言
int
型
数组
转化为char
型
字符串
数组
本文介绍了一种C语言中将
int
型
数组
转化为char
型
字符串
数组
的方法,通过自定义函数实现数字到
字符串
的转化,并提供了完整的代码示例及运行结果。
【C】C语言判断
字符串
是否是
int
型
正整数
本文介绍了一个C语言程序,用于判断用户在CMD下输入的
字符串
是否为
int
型
正整数。通过遍历
字符串
并使用isdigit()函数检查每个字符,确保所有字符都是数字且不超过100位。
Java将String
型
字符串
转换成
int
型
(或
int
型
数组
)
本文介绍了一种将
字符串
转换为
int
型
数组
的方法,并演示了如何将整个
字符串
转换为一个整数。通过实例代码,展示了使用Java的substring和parse
Int
函数进行类
型
转换的过程。
字符串
、字符
数组
与
int
型
数据的相互转换
本文详细介绍了Java中不同类
型
之间的转换方法,包括
int
与String之间的转换、String
数组
与
字符串
之间的转换、char
数组
与
字符串
之间的转换以及
字符串
与其他类
型
之间的转换。此外,还提供了一些实用的示例代码。
Java SE
62,621
社区成员
307,251
社区内容
发帖
与我相关
我的任务
Java SE
Java 2 Standard Edition
复制链接
扫一扫
分享
社区描述
Java 2 Standard Edition
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章