不使用拆分方法拆分文本行 [英] Split a text line without using Split method

查看:74
本文介绍了不使用拆分方法拆分文本行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在C Sharp Console编程中不使用拆分方法的情况下基于空格字符拆分文本行.
感谢

how to split a text line on basis of space characters without using split method in C sharp Console programming.
Thanks

推荐答案

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

希望对您有帮助
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


这篇关于不使用拆分方法拆分文本行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆