如何从文本框中选择右侧或左侧的字段 [英] how to select fields from right or left from textbox
本文介绍了如何从文本框中选择右侧或左侧的字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨大家..我无法迁移到vb.net代码..我的问题是,我不知道什么代码相当于vb6代码,我用来修剪文本框中的值或文本从右或左或中..我在vb6上的代码是正确的(val(txt1.text),2)..抱歉我的英文不好..
解决方案
String.Trim [ ^ ]两端都结束
String.TrimStart [ ^ ]只做左侧
String.TrimEnd [< a href =http://msdn.mi crosoft.com/en-us/library/system.string.trimend.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-2\"target =_ blanktitle =新窗口> ^ 只做正确的。
您可以选择提供要修剪的字符列表,否则它只使用标准的空格字符。
hi guys.. im having trouble migrating to vb.net codes.. my problem is that i dont know what code is equivalent to vb6 code that im using to trim a value or text on a textbox from right or left or mid.. my code on vb6 is for example right(val(txt1.text),2).. sorry guys for my bad english..
解决方案
String.Trim[^] does both ends
String.TrimStart[^] does the left side only
String.TrimEnd[^] does only the right.
You can optionally provide a list of characters to trim, otherwise it uses just the standard white space characters.
这篇关于如何从文本框中选择右侧或左侧的字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文