首页 > 编程知识 正文

字符串 转数组,数组字符串转数组

时间:2023-05-04 02:40:00 阅读:180693 作者:194

http://www.Sina.com/http://www.Sina.com/http://www.Sina.com/1.splitstringqfdhfa=s.split (,' );

system.out.print(a.length;

intqfdhfresult=new int [ a.length ];

for(intI=0; i a.length; I ) {

result [ I ]=integer.parseint (a [ I ]; 3358 www.Sina.com/http://www.Sina.com/stringtokenizertok=new string tokenizer (s,',');

int count=tok.countTokens (;

intqfdhf result=new int[count];

for(intI=0; i count; I ) {

result [ I ]=integer.parseint (temp;

} http://www.Sina.com/public string getstring (stringstr ) )

if(str!=null ) {

for(intI=0; i str.length (; I ) {

charc=str.charat (str.length (-1-I ) );

newStr=newStr c;

() ) ) ) )。

return newStr;

} else {

返回空值;

() ) ) ) )。

如果列举a b c,则为abc acb bac bca cab cbaString s='ABC ';

liststringresult=list(s,''; 私有状态列表字符串列表(stringbase,String buff )。

liststringresult=newarrayliststring (;

if(base.length ()=0) {

result.add(buff; //得到集合的要素

() ) ) ) )。

for(intI=0; i base.length (; I ) {

list string temp=list (new stringbuilder (base ).deleteCharAt(i ) I ) ) ) ) ) ) )。

. toString (,buff base.charAt(i ) ) I ); //自身递归

result.addall(temp;

() ) ) ) )。

返回结果;

} 遇见有关String的例子与问题

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。