日期:2014-05-17  浏览次数:20467 次

初学ASP.NET, 询问个简单问题, LEFT , RIGHT, SUBSTRING这些函数没有吗?
C# code

        protected void txtJob_TextChanged(object sender, EventArgs e)
        {
            if (txtJob.Text.ToString().Trim() != "")
            {
                
                if (Left(txtJob.Text.ToString(),3) == "ECN")
                { 
                }
            }
                
        }



怎么上面代码提示Left这个函数不存在??

------解决方案--------------------
无需要有,Substring已经够用了
------解决方案--------------------
string.isnullorempty
txtJob.Text.Substring
------解决方案--------------------
引用 Microsoft.VisualBasic.dll 
那些方法都有了

------解决方案--------------------
return;

------解决方案--------------------
这孩子是写asp出身的。
------解决方案--------------------
SQL SERVIER 中 有 left 和 right 

c# 中 只有 substring(startindex,length);

如果你要向用这2个函数可以自己 写。