调用strsplit:
public string Ssl()
{
try
{
ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
using (var wc = new WebClient())
{
var res = wc.DownloadString("https://untrusted-root.badssl.com/");
Console.WriteLine(res);
return res;
}
}
catch (Exception ex)
{
return ex.ToString();
}
}
我以为我可以拉出每个中的倒数第二个值;即4和8通过
example <- (strsplit(data$col, ","))
[[1]]
[1] "1", "2", "3", "4", "5"
[[2]]
[1] "4", "5", "6", "7", "8", "9"
情况不是这样吗?我得到了不寻常的答案
答案 0 :(得分:0)
两种选择:
sapply(example, function(x) tail(x, 2)[1]) # option 1
sapply(example, function(x) x[length(x)-1]) # option 2