Topic: 字符串怎么转化为数组?

  Print this page

1.字符串怎么转化为数组? Copy to clipboard
Posted by: q_yuan
Posted on: 2004-11-24 09:43

请高手指点一下,我从键盘上输入一个字符串,然后我要把这个字符串转化为一个数组,要怎么转化啊?用什么语句,或者来一个简单的例子!
谢谢!

2.Re:字符串怎么转化为数组? [Re: q_yuan] Copy to clipboard
Posted by: xport
Posted on: 2004-11-26 14:51


String a = null;
/*your input code here*/
Byte[] aryInputStr = null;
aryInputStr = a.getBytes();

3.Re:字符串怎么转化为数组? [Re: q_yuan] Copy to clipboard
Posted by: yorksaddam
Posted on: 2004-11-29 10:48

String 类下面有一个方法
toArrayChar(String s)

好象是这样的,只不过我每次编写程序的时候都要翻书的
任何程序只是算法的问题,其他都是一样的


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923