开发者

checking if array[key] isset? throw: index out of range

if i try to access key in 开发者_如何学JAVAarray which does not exist i get throw: index out of range with a stacktrace.

How do i check if tmp[key] "is set" ?


This accualy works:

if len(url) > 1 {
    tmp := strings.Split(url[1],"=",0);
    if len(tmp) >1{
        sess = tmp[1];
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜