C#文本框串分离 [英] C# Textbox string separation

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

问题描述

我有文本框,在C#中,包含两个或三个字符串用空格。我想存储这些字符串seperately.please,建议我的任何代码。感谢名单。


解决方案

  VAR复数值= @asdfasdfsdf asdfasd FFFFF 
asdfasdfasdf ;
VAR complexValues​​ = complexValue.Split();



注意:结果
.Split()是一个伪超载,因为它被编译为 .Split(新的char [0])。结果
另外 MSDN 告诉我们:




如果分隔参数为
空或包含
没有字符,空白字符
被认为是分隔符。
空白字符由$ B $定义B中的Unicode标准,如果他们被传递到
返回true,
Char.IsWhiteSpace 方法。



I have textbox in c#, contains two or three strings with white spaces. i want to store those strings seperately.please, suggest me any code. thanx.

解决方案

var complexValue = @"asdfasdfsdf asdfasd fffff
asdfasdfasdf";
var complexValues = complexValue.Split();

NOTICE:
.Split() is a pseudo-overload, as it gets compiled as .Split(new char[0]).
additionally msdn tells us:

If the separator parameter is null or contains no characters, white-space characters are assumed to be the delimiters. White-space characters are defined by the Unicode standard and return true if they are passed to the Char.IsWhiteSpace method.

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

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