標籤:test()var str = "cat";var reStr = /cat/;alert(reStr.test(str));輸出為:true它的傳回值為true or false ;exec()var str = "a bat , a Cat , a fat cat";var reStr = /at/;var arrMatch = reStr.exec(str);輸出為:at它的傳回值為第一次匹配;match()var str = "a bat , a Cat , a fat cat";
標籤:Combination Sum IIGiven a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.Each number in C may only be used once in the
標籤:Combination Sum IIIFind all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be a unique set of numbers.Ensure that numbers within the set are
標籤:<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"/><title>JavaScript控制頁面5秒後自動跳轉的代碼</title><script type="text/javascript"> function countDown(secs,surl){ //alert(surl); var jumpTo
標籤:本章討論Javascript的String和數組。所有語言中對String和數組的操作是很普遍的,掌握好它們的操作,會讓我們在lu代碼的時候事半功倍。一、String String顧名思義,就是字串的意思var string="Iamhandsome";就建立了一個名為string的字串,它的值為Iamhandsome。String是Javascript基礎資料型別 (Elementary Data
[轉]響應式web設計之CSS3 Media Queries,css3queries開始研究響應式web設計,CSS3 Media Queries是入門。Media Queries,其作用就是允許添加運算式用以確定媒體的環境情況,以此來應用不同的樣式表。換句話說,其允許我們在不改變內容的情況下,改變頁面的布局以精確適應不同的裝置。那麼,Media Queries是如何工作的?兩種方式,一種是直接在link中判斷裝置的尺寸,然後引用不同的css檔案:<link