C#?????StringBuilder??????????
???????????? ???????[ 2016/3/14 11:00:35 ] ??????????????????? .NET
	??????????????StringBuilder??????????????
	???????????????????????????select?????????
	private static string BuilderSelectBox(IDictionary<int?? string> options?? string id?? bool includeUnknown)
	{
	var html = new StringBuilder();
	html.AppendFormat("<select id="{0}" name="{0}">"?? id);
	html.AppendLine();
	if(includeUnknown)
	{
	html.AppendLine("	<option>Unknown</option>");
	}
	foreach(var opt in options)
	{
	html.AppendFormat("	<option value="{0}">{1}</option>"?? opt.Key?? opt.Value);
	html.AppendLine();
	}
	html.AppendLine("</select>");
	return html.ToString();
	}
	?????????
	????html.AppendFormat("<select id="{0}" name="{0}">"?? id);
	????html.AppendLine();
	?????????????????????????StringBuilder??
	???????
	public static class StringBuilderExtensions
	{
	public static StringBuilder AppendFormattedLine(this StringBuilder @this?? string format?? prams object[] args) => @this.AppendFormat(format?? args).AppendLine();
	}
	private static string BuilderSelectBox(IDictionary<int?? string> options?? string id?? bool includeUnknown)
	{
	var html = new StringBuilder()
	.AppendFormattedLine("<select id="{0}" name="{0}">"?? id);
	if(includeUnknown)
	{
	html.AppendLine("	<option>Unknown</option>");
	}
	foreach(var opt in options)
	{
	html.AppendFormattedLine("	<option value="{0}">{1}</option>"?? opt.Key?? opt.Value);
	html.AppendLine();
	}
	html.AppendLine("</select>");
	return html.ToString();
	}
	?????????
	????if(includeUnknown)
	????{
	????html.AppendLine("	<option>Unknown</option>");
	????}
	??????????????????з???????????StringBuilder.
	public static class StringBuilderExtensions
	{
	public static StringBuilder AppendFormattedLine(this StringBuilder @this?? string format?? prams object[] args) => @this.AppendFormat(format?? args).AppendLine();
	public static StringBuilder AppendLineWhen(this StringBuilder @this?? Func<bool> predicate?? string value) =>
	predicate()
	? @this.AppendLine(value)
	: @this;
	}
	private static string BuilderSelectBox(IDictionary<int?? string> options?? string id?? bool includeUnknown)
	{
	var html = new StringBuilder()
	.AppendFormattedLine("<select id="{0}" name="{0}">"?? id)
	.AppendLineWhen(() => includeUnknown?? "	<option>Unknown</option>");
	foreach(var opt in options)
	{
	html.AppendFormattedLine("	<option value="{0}">{1}</option>"?? opt.Key?? opt.Value);
	}
	html.AppendLine("</select>");
	return html.ToString();
	}
	
??????
 
					
					???·???
App??С????H5?????????????????Щ??
2024/9/11 15:34:34?????????????????????????
2024/9/10 11:13:49P-One ???????????????????????????????????????
2024/9/10 10:14:12???????????????????????????
2024/9/9 18:04:26??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44 
					
 
			 
								 
								 
								 
								 
								 
								 
								 
								 
								 
								 
				 sales@spasvo.com
sales@spasvo.com