使用for循环的字符串concatination [英] string concatination using for loop

查看:186
本文介绍了使用for循环的字符串concatination的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们,



请考虑以下问题。



i正在为xml开发窗口应用程序editing.i有这样的字符串值(例如,样本快速观察)。基于空格()我拆分字符串。在我拆分后,它将像下面的

样本

快速

观察。

然后我检查每个单词。完成后我想在单行中形成字符串。我可以做最后一步?



提前感谢

dear friends,

plz consider the below problem.

i am developing window application for xml editing.i have string value like this (eg.,sample quick watch).based on the space(" ")i split the string.after i split, it will be like the below
sample
quick
watch.
then i check every word.after completion i want to form the string in a single line.how can i do the last step?

thanks in advance

推荐答案



< b / b
如下所示。

Hi,

try like below.
dim strArr as String() = value.Split(" ")
dim newStr as String = ""
For Each str As String In strArr 
'Do your logic to check the words
newStr += str
Next

'display newStr



希望有帮助


hope it helps


Hi Jai



试试喜欢下面:



Hi Jai

Try like below:

string strValue = "Ram,suresh";
string[] strArray = strValue.Split(',');
string.Join(",", strArray);


这篇关于使用for循环的字符串concatination的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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