首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

C#中怎么实现从字符里取字

2011-12-23 
C#中如何实现从字符里取字VB中dimstrY1asstringstrY1Left( abcdefgh ,4)在C#中如何实现?[解决办法]s

C#中如何实现从字符里取字
VB中   "   dim   strY1   as   string
            strY1   =   Left( "abcdefgh ",   4);           "
在C#中如何实现?

[解决办法]
string strY1= "abcdefgh ";
strY1 = strY1.Substring(0,4);
[解决办法]
string strY1 = "abcdefgh ".SubString(0, 4);

热点排行