异常语句 int cuo = 0; Console.WriteLine("请输入:"); string s = Console.ReadLine(); try { DateTime dt = DateTime.Parse(s); } catch (Exception ex) { Console.WriteLine("不是"); cuo = 1; } if (cuo == 0) { Console.WriteLine("正确"); } math的方…
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> new document </ti…
一.表中字符串带空格的原因 1,空格就是空格. 2,控制符 显示为 空格. 二.解决方法 第一种情况,去空格的处理的比较简单,Replace(column,' ','') 就可以解决. 第二种情况,解决方法就比较麻烦点:需要先查出相应的ASCII码,再用Replace(column,char(ascii码),'')解决,以下举个栗子: CREATE TABLE #temp (NAME NVARCHAR(50)) INSERT INTO #temp SELECT '明天就是国庆了'+CHAR(10…
//定义一个可变字符串, Format后面可以跟字符串类型,也可以传入C语言的字符串数组 NSMutableString *str = [NSMutableString stringWithFormat:@"<#NSString#>"]; // 获取NSMutableString或NString 某位置的字符 NSMutableString *newS1=[NSMutableString stringWithString:s1]; ; i<s1.length; i++…
1.jquery取复选框的值 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv…
1.jquery取复选框的值<!--引入jquery包--> <script src="../jquery-1.11.2.min.js"></script><!--引入的jquery一定是在最上面的--> <style type="text/css"> </style> </head> <body> <input type="checkbox"…
写成类的方法格式如下:(str.trim();) <script language="javascript"> String.prototype.trim=function(){     return this.replace(/(^\s*)|(\s*$)/g, ""); } String.prototype.ltrim=function(){     return this.replace(/(^\s*)/g,""); } Stri…
1.jquery取复选框的值 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv…
1.jquery取复选框的值 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv…
1.正则去空格 a.去掉字符串中所有空格 " hello world ".replace(/\s+/g,"");//helloworld b.去掉字符串左边空格 var str = " hello world ".replace(/^\s*/g,"");//hello world.. c.去掉字符串右边空格 var str = " hello world ".replace(/\s*$/g,"&q…