分裂一个长串 [英] Splitting a long string

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

问题描述

大家好,

我有一个1500或更多字符的字符串。但是我想通过这个字符串并在160号分割它但它不应该在这个单词的中间分开。如果第160个字符不是单词的结尾,则应该返回到下一个单词并从中拆分。我的代码在下面,但它不能正常工作

Hi All,
I have a string of 1500 or more characters. but I want to go through this string and split it at the 160th but it should not split in the middle of the word. If the 160th character is not the end of a word it should go back to the next word and split from that. My code is below but its not working well

展开 | 选择 | Wrap | 行号

推荐答案

你能不能提供您正在使用的数据样本?这样我们就可以使用你正在使用的东西。


问候,


Jeff
Would you be able to provide a sample of the data with which you are working? That way we can have something to work with that you are also using.

Regards,

Jeff


Text :: Wrap

展开 | 选择 | Wrap | 行号


这篇关于分裂一个长串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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