【问题】
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#中的字符串数组