C#相关问题

罚酒饮得 2017-10-16 07:17:53






为什么加了StringSplitOptions.RemoveEmptyEntries就不会出现错误提示?
...全文
672 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
无情时尚 2017-10-17
  • 打赏
  • 举报
回复
学会看API,API说得很清楚
        //
        // 摘要:
        //     Returns a string array that contains the substrings in this instance that are
        //     delimited by elements of a specified Unicode character array.
        //
        // 参数:
        //   separator:
        //     An array of Unicode characters that delimit the substrings in this instance,
        //     an empty array that contains no delimiters, or null.
        //
        // 返回结果:
        //     An array whose elements contain the substrings in this instance that are delimited
        //     by one or more characters in separator. For more information, see the Remarks
        //     section.
        public String[] Split(params char[] separator);
        //
        // 摘要:
        //     Returns a string array that contains the substrings in this string that are delimited
        //     by elements of a specified Unicode character array. A parameter specifies whether
        //     to return empty array elements.
        //
        // 参数:
        //   separator:
        //     An array of Unicode characters that delimit the substrings in this string, an
        //     empty array that contains no delimiters, or null.
        //
        //   options:
        //     System.StringSplitOptions.RemoveEmptyEntries to omit empty array elements from
        //     the array returned; or System.StringSplitOptions.None to include empty array
        //     elements in the array returned.
        //
        // 返回结果:
        //     An array whose elements contain the substrings in this string that are delimited
        //     by one or more characters in separator. For more information, see the Remarks
        //     section.
        //
        // 异常:
        //   T:System.ArgumentException:
        //     options is not one of the System.StringSplitOptions values.
        [ComVisible(false)]
        public String[] Split(char[] separator, StringSplitOptions options);
        //
        // 摘要:
        //     Returns a string array that contains the substrings in this string that are delimited
        //     by elements of a specified string array. A parameter specifies whether to return
        //     empty array elements.
        //
        // 参数:
        //   separator:
        //     A string array that delimits the substrings in this string, an empty array that
        //     contains no delimiters, or null.
        //
        //   options:
        //     System.StringSplitOptions.RemoveEmptyEntries to omit empty array elements from
        //     the array returned; or System.StringSplitOptions.None to include empty array
        //     elements in the array returned.
        //
        // 返回结果:
        //     An array whose elements contain the substrings in this string that are delimited
        //     by one or more strings in separator. For more information, see the Remarks section.
        //
        // 异常:
        //   T:System.ArgumentException:
        //     options is not one of the System.StringSplitOptions values.
        [ComVisible(false)]
        public String[] Split(String[] separator, StringSplitOptions options);
        //
        // 摘要:
        //     Returns a string array that contains the substrings in this instance that are
        //     delimited by elements of a specified Unicode character array. A parameter specifies
        //     the maximum number of substrings to return.
        //
        // 参数:
        //   separator:
        //     An array of Unicode characters that delimit the substrings in this instance,
        //     an empty array that contains no delimiters, or null.
        //
        //   count:
        //     The maximum number of substrings to return.
        //
        // 返回结果:
        //     An array whose elements contain the substrings in this instance that are delimited
        //     by one or more characters in separator. For more information, see the Remarks
        //     section.
        //
        // 异常:
        //   T:System.ArgumentOutOfRangeException:
        //     count is negative.
        public String[] Split(char[] separator, int count);
        //
        // 摘要:
        //     Returns a string array that contains the substrings in this string that are delimited
        //     by elements of a specified Unicode character array. Parameters specify the maximum
        //     number of substrings to return and whether to return empty array elements.
        //
        // 参数:
        //   separator:
        //     An array of Unicode characters that delimit the substrings in this string, an
        //     empty array that contains no delimiters, or null.
        //
        //   count:
        //     The maximum number of substrings to return.
        //
        //   options:
        //     System.StringSplitOptions.RemoveEmptyEntries to omit empty array elements from
        //     the array returned; or System.StringSplitOptions.None to include empty array
        //     elements in the array returned.
        //
        // 返回结果:
        //     An array whose elements contain the substrings in this string that are delimited
        //     by one or more characters in separator. For more information, see the Remarks
        //     section.
        //
        // 异常:
        //   T:System.ArgumentOutOfRangeException:
        //     count is negative.
        //
        //   T:System.ArgumentException:
        //     options is not one of the System.StringSplitOptions values.
        [ComVisible(false)]
        public String[] Split(char[] separator, int count, StringSplitOptions options);
        //
        // 摘要:
        //     Returns a string array that contains the substrings in this string that are delimited
        //     by elements of a specified string array. Parameters specify the maximum number
        //     of substrings to return and whether to return empty array elements.
        //
        // 参数:
        //   separator:
        //     A string array that delimits the substrings in this string, an empty array that
        //     contains no delimiters, or null.
        //
        //   count:
        //     The maximum number of substrings to return.
        //
        //   options:
        //     System.StringSplitOptions.RemoveEmptyEntries to omit empty array elements from
        //     the array returned; or System.StringSplitOptions.None to include empty array
        //     elements in the array returned.
        //
        // 返回结果:
        //     An array whose elements contain the substrings in this string that are delimited
        //     by one or more strings in separator. For more information, see the Remarks section.
        //
        // 异常:
        //   T:System.ArgumentOutOfRangeException:
        //     count is negative.
        //
        //   T:System.ArgumentException:
        //     options is not one of the System.StringSplitOptions values.
        [ComVisible(false)]
        public String[] Split(String[] separator, int count, StringSplitOptions options);
内容简介 《C#编程宝典(十年典藏版)》是一本集技能、范例、项目和应用为一体的学习手册,书中介绍了应用C#进行程序开发的各种技术和技巧。全书分4篇,共24章,其中,第1篇为技能学习篇,主要包括做好C#程序开发前期准备、掌握c#语言基础之数据类型与变量、领略运算符和表达式带给我们的神奇、巧用流程控制语句、算法、字符串、数组、步入面向对象程序设计的殿堂、使用Windows窗体搭建交互式图形界面、你所必须知道的Windows控件、掌握能够辅助程序开发的Windows控件、数据库管理系统开发必备、LINQ数据访问技术、程序调试与错误处理、打包部署等内容;第2篇为范例演练篇,主要包括基础应用相关、数据库开发相关、图形图像及多媒体应用、WPF图形化显示系统等相关的范例;第3篇为项目实战篇,主要包括明日快递单打印系统、QQ自动登录器、雷速网络下载专家、编程词典销售分析系统等4个小型项目;第4篇为商业系统篇,主要介绍一个大型的商业项目,即企业ERP管理系统(C/S架构)。 《C#编程宝典(十年典藏版)》附有配套DVD光盘,光盘中提供了书中全部实例和项目的源代码,这些源代码全部经过精心调试,能够在Windows XP、Windows Server 2003以及Windows 7操作系统下编译和运行。 《C#编程宝典(十年典藏版)》适用于C#的初学者、编程爱好者,同时也可以作为培训机构、大中专院校老师和学生的学习参考用书。

110,537

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧