从标签获取垂直线 [英] to get a perticular string from label
本文介绍了从标签获取垂直线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从标签中找到一个垂直的字符串,然后从标签中删除该字符串.标签包含一个长字符串,但我想选择一个子字符串(在c#中)
...请使用Substring
方法帮助我
解决方案
http://www.dotnetperls.com/substring [ 字符串输入= " ; // 获取前三个字符 字符串 sub =input.Substring( 0 , 3 ); Console.WriteLine(" ,子); // 结果一个
为此,您可以使用 Regex .
另请参见有关正则表达式语言的MSDN主题.
在问这样的问题之前阅读一些MSDN怎么样?
请参阅:
http://msdn.microsoft.com/en-us/library/system.string.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/hxthx5h6.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/aka44szs.aspx [ ^ ].
当然,所有Label
类型(不止一种)都具有字符串属性来为其分配值,例如"Text"或"Context"…
我猜你真的需要它吗:
Microsoft QQ209354 .
—SA
i want to find a perticular string from a label and delete that string from label. label contains a long string but i want to select a substring(in c#)
... please help me out
解决方案
using theSubstring
method
http://www.dotnetperls.com/substring[^]
string input = "OneTwoThree"; // Get first three characters string sub = input.Substring(0, 3); Console.WriteLine("Substring: {0}", sub); //result One
You can use a Regex for that purpose.
See also the MSDN topic about Regular Expression Language.
How about reading some MSDN before asking questions like that?
Please see:
http://msdn.microsoft.com/en-us/library/system.string.aspx[^],
http://msdn.microsoft.com/en-us/library/hxthx5h6.aspx[^],
http://msdn.microsoft.com/en-us/library/aka44szs.aspx[^].
And of course, allLabel
types (there are more than one) have string properties to assign a value to, such as "Text" or "Context"…
I guess what you really need it this:
Microsoft QQ209354.
—SA
这篇关于从标签获取垂直线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文