且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

不使用拆分方法拆分文本行

更新时间:2022-12-22 14:59:44

进行循环检查字符串中的每个字符是否为空格.保留所有已确认索引的日志,然后使用子字符串拆分字符串.

希望对您有帮助
Go through a loop checking each character in the string whether it is a space. Keep a log of all the indexes that are confirmed, and then use substring to split the string.

Hope this helps


您可以使用indexof函数查找空间索引,并使用子字符串函数将其拆分
You can use indexof function to find the index of space and split them using substring function