最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】C#中的字符串数组

C# crifan 2292浏览 0评论

【问题】

C#中,需要用到字符串数组,

并且需要传递到一个函数中,是out类型的,需要返回值的。

【解决过程】

1.后来经过尝试,这样写:

string[] bullets;
string description = "";
extractBulletAndDescription(productUrl, respHtml, out bullets, out description);


private void extractBulletAndDescription(string productUrl, string respHtml, out string[] bullets, out string description)
{
    description = "";
    bullets = new string[5];
    bullets[0] = "";
    bullets[1] = "";
    bullets[2] = "";
    bullets[3] = "";
    bullets[4] = "";
}

貌似是可以的。

 

【总结】

还是很不好用啊。还是Python用的爽。

转载请注明:在路上 » 【已解决】C#中的字符串数组

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.163 seconds, using 22.03MB memory