14.字符串拆分
Posted 许先
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了14.字符串拆分相关的知识,希望对你有一定的参考价值。
public class Lyric { /** * 拆分歌词 * */ public static void main(String[] args) { String words="长亭外 古道边 芳草碧连天 晚风扶 柳笛声残 夕阳山外山"; String[] printword=new String[100];//接收数组 System.out.println("***原歌词格式***\n"+words); System.out.println("\n***拆分后歌词格式***"); printword=words.split(" ");//按照空格进行拆分 for(int i=0;i<printword.length;i++){ System.out.println(printword[i]);//打印输出 } } }
以上是关于14.字符串拆分的主要内容,如果未能解决你的问题,请参考以下文章
VSCode自定义代码片段14——Vue的axios网络请求封装
VSCode自定义代码片段14——Vue的axios网络请求封装