阅读背景:

将字符串分割为已定义的数组

来源:互联网 

Basically what I need to do is only save the first ten words of a sentence into the Array. I know from my code that all the words will be saved if it is greater than 10, but I only iterate through the loop 10 times so it stops. However, if the sentence has less than 10 words, I need to fill it with an empty string. So I can get it to work if it has 10 or more words. However, I cannot get it to work if there is less than 10 words. Does anyone know of a way to make it work? I have to have an Array size of 10.Basically what I need to do is only save the fi




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: