ÎÒÏëÔÚC#ÖÐдһ¸öÀàËÆleftº¯ÊýµÄ·½·¨£¬ÓиöǰÌáÊDz»ÓÃsubstring·½·¨¡£Çó½â£¡£¡£¡
C# code:
string Left(string str,int len)
{
if(str.Length < len)
throw new Exception("×Ö·û´®³¤¶È²»ÄÜÉÙÓÚ" + len);
else if(str.Length == len)
return str;
char[] cs = new char[len];
for(int i = 0; i < len; i++)
{
cs[i] = str[i];
}
return new string(cs);
}
²ÎÊý¶¨ÎªStringÀàÐ͵Ä×Ö·û´®ºÍintÀàÐ͵ÄCount£¬ÒÔÊý×éµÄ·½Ê½ÒÀ´Î·ÃÎÊ×Ö·û´®ÖÐǰCount-1¸ö×Ö·ûÔÙʹÓÃStringBuilder¹¹Ôì×Ö·û´®,Èç¹ûCountΪ0»òÔ×Ö·û´®Îª¿ÕÔò·µ»Ø¿Õ´®£¬Èç¹ûCount´óÓÚÔ×Ö·û´®³¤¶È,Ôò·µ»ØÕû¸ö×Ö·û´®£¬
δ¿¼ÂÇÐÔÄÜ£¡
C# code:
string Left(string str,int len)
{
if(str.Length < len || len == 0)
throw new Exception("×Ö·û´®³¤¶È²»ÄÜÉÙÓÚ" + len);
else if(str.Length == len)
return str;
return str.Remove(len);
}
ÒýÓà C# codestring Left(string str,int len) {if(str.Length< len|| len==0) thrownew Exception("×Ö·û´®³¤¶È²»ÄÜÉÙÓÚ"+ len); elseif(str.Length== len) return str; return str.Remove(len); }Õâ¶Î´úÂë²»´í...²»¹ýleft·½·¨·µ»ØµÄ·½Ê½ËƺõÊÇ£º
Ïà¹ØÎÊ´ð£º
Ϊʲô¹¤¾ßÀ¸°´Å¤µÄ¿í¶È¸Ä±ä²»ÁË,ÔÚÊôÐÔÀï¸ÄÁËÓÖ±ä³ÉÔÀ´µÄÊýÖµÁË ´óºú×ÓÕæÀ÷º¦£¬»Ø´ð»ù±¾¶¼ÊDZ¬Áϼ¶µÄ ´óºú×ÓÉý¼¶Õæ¿ì°¡£¬Õâ²Å¼¸Ìì¾Í5Ìõ¶Ì¿ãÍâ¼ÓÔÂÅÅÃûµÚÒ»ÁË ÏëÏëÎÒÕâ5¸ö¶Ì¿ã»ìÁ˲¶à8Äê²ÅµÃµ½µÄ¡£ »Ø¸´ ......
ΪʲôÎÒÓÃform.showºÍform.hide¶à´ÎÁ¬½ÓÁËÁ½¸ö´°¿ÚÖ»ÄÜ»¥»»Á´½ÓÁ½´Î°¡£¿ ´úÂë¿´¿´ ÕÕµÀÀíform.show û´ÎÊýÏÞ¶¨µÄ°É ÎÒÒ²¿ì·èÁË¡£ Â¥Ö÷ÖªµÀÔõô·¢Ìùô£¿ ÒýÓà ÎÒÒ²¿ì·èÁË¡£ Â¥Ö÷ÖªµÀÔõô·¢Ìùô£¿ Â¥Ö÷Ò² ......
DIM ds as new DataSet ÎÒÕâÑùÉùÃ÷ ÔõÀÏÊDZ¨ Óû§¶¨ÒåÀàÐÍ䶨Ò壿 Õâ¸öÐèÒªÒýÓÃʲôÂ𣿣¿ ǰÌáÊÇDataSet¶ÔÏóÒª´æÔÚ,¾ÍÊǶÔÏóä¯ÀÀÆ÷ÖÐÓÐËü.ûÓоÍÒªÒýÓÃ. datasetÊÇADO.NET¶ÔÏó Èç¹ûÄãÓõÄÊÇvb.net£¬ÄÇôÔÚ´ ......
ÏÖÔÚÎÒÏë¸ù¾ÝtreeviewÉÏÿ¸ö½ÚµãµÄȨÏÞ£¬Ã»ÓÐȨÏ޵Ľڵ㲻Äܱ»Ñ¡ÖУ¬¶øÇҳɻÒÉ«£¬ÔõôʵÏÖ£¬ÔÚÏߵȡ£¡£¡£ Õâ¸ö£¿¡£¡£¡£ Ã²ËÆÃ»·¨¡£ ÊÔÊÔÄܲ»ÄܸÄijЩnodeµÄÑÕÉ«£¬¼Ç¼ÏÂÉϴεÄnodeclickÀïµÄnode¡£ Ï´εã»÷µÄÈç¹ ......
ÎÒÏë°ÑwordÁí´æÎªxmlÖ®ºó£¬ÓÃvb¶ÁÈ¡Õâ¸öxmlµÄÄÚÈÝ£¬ÇëÎÊÈçºÎʵÏÖ£¿ dim f as integer dim b() as byte dim s as string dim L as long f=freefile() open "abc.xml" for binary access read as #f ......