url.split()方法

split()方法是将指定字符串按某指定的分隔符进行拆分,拆分将会形成一个字符串的数组并返回
如:string str = "aa.bb.cc.dd";
    string[] strArray = str.Split(‘.‘);
所得到的结果strArray的值为 string[]{"aa","bb","cc","dd"}
其中"aa","bb","cc","dd"即是构成数组strArray的元素
数组中的每元素都各自对应一个索引值,就好比在数据库的表中每行数据纪录都拥有自己的索引ID一样
数组元素的索引值是从0开始计数的,也就是说第一个元素的索引值是0,往后依次加1
我们可以用数组的索引值来取对应位置的数组元素的值,比如说我们要取数组的第一个元素 “aa”,那么我们就可以这样写 :
string aa = strArray[0];
这里split(‘.‘)[1] 是一种缩写形式,把它拆开来看实际就是
先用split(‘.‘)方法将字符串以"."开割形成一个字符串数组,然后再通过索引[1]取出所得数组中的第二个元素的值
posted @ 2019-03-12 15:47  strawqqhat  阅读(380)  评论(0编辑  收藏  举报
#home h1{ font-size:45px; } body{ background-image: url("放你的背景图链接"); background-position: initial; background-size: cover; background-repeat: no-repeat; background-attachment: fixed; background-origin: initial; background-clip: initial; height:100%; width:100%; } #home{ opacity:0.7; } .wall{ position: fixed; top: 0; left: 0; bottom: 0; right: 0; } div#midground{ background: url("https://i.postimg.cc/PP5GtGtM/midground.png"); z-index: -1; -webkit-animation: cc 200s linear infinite; -moz-animation: cc 200s linear infinite; -o-animation: cc 200s linear infinite; animation: cc 200s linear infinite; } div#foreground{ background: url("https://i.postimg.cc/z3jZZD1B/foreground.png"); z-index: -2; -webkit-animation: cc 253s linear infinite; -o-animation: cc 253s linear infinite; -moz-animation: cc 253s linear infinite; animation: cc 253s linear infinite; } div#top{ background: url("https://i.postimg.cc/PP5GtGtM/midground.png"); z-index: -4; -webkit-animation: da 200s linear infinite; -o-animation: da 200s linear infinite; animation: da 200s linear infinite; } @-webkit-keyframes cc { from{ background-position: 0 0; transform: translateY(10px); } to{ background-position: 600% 0; } } @-o-keyframes cc { from{ background-position: 0 0; transform: translateY(10px); } to{ background-position: 600% 0; } } @-moz-keyframes cc { from{ background-position: 0 0; transform: translateY(10px); } to{ background-position: 600% 0; } } @keyframes cc { 0%{ background-position: 0 0; } 100%{ background-position: 600% 0; } } @keyframes da { 0%{ background-position: 0 0; } 100%{ background-position: 0 600%; } } @-webkit-keyframes da { 0%{ background-position: 0 0; } 100%{ background-position: 0 600%; } } @-moz-keyframes da { 0%{ background-position: 0 0; } 100%{ background-position: 0 600%; } } @-ms-keyframes da { 0%{ background-position: 0 0; } 100%{ background-position: 0 600%; } }