开发者社区 问答 正文

如何用代码形式实现字符串的部分拆分处理?

已解决

如何用代码形式实现字符串的部分拆分处理?

展开
收起
起起又伏伏 2022-04-02 23:14:54 538 分享
分享
版权
举报
1 条回答
写回答
取消 提交回答
  • 推荐回答

    public class StringDemo

    public static void main(string args[]) {

    String str = "hello world hello mldn" ;

    String result [] =str.split("",2); //按照空格拆分

    for (int x=0;x<result.length;x++){

    System.out.println(result[x]);

    }

    }

    }

    2022-04-02 23:22:20 举报
    赞同 评论

    评论

    全部评论 (0)

    登录后可评论
问答地址: