12,930
回編集
細 (文字列「source lang」を「syntaxhighlight lang」に置換) |
細 (文字列「</source>」を「</syntaxhighlight>」に置換) |
||
15行目: | 15行目: | ||
return source.Select(group => string.Format("Key={0}, Source={1}", group.Key, group.ToResult())).ToResult(); | return source.Select(group => string.Format("Key={0}, Source={1}", group.Key, group.ToResult())).ToResult(); | ||
} | } | ||
</ | </syntaxhighlight> | ||
<br><br> | <br><br> | ||
62行目: | 62行目: | ||
Console.WriteLine(source.Single(e => e < 4 )); | Console.WriteLine(source.Single(e => e < 4 )); | ||
// → 3 | // → 3 | ||
</ | </syntaxhighlight> | ||
<br><br> | <br><br> | ||
104行目: | 104行目: | ||
Console.WriteLine(source.TakeWhile(e => e < 5).ToResult()); | Console.WriteLine(source.TakeWhile(e => e < 5).ToResult()); | ||
// → {3, 4} | // → {3, 4} | ||
</ | </syntaxhighlight> | ||
<br><br> | <br><br> | ||
151行目: | 151行目: | ||
Console.WriteLine(source.Sum(e => Math.Pow(e - ave, 2)) / source.Count()); | Console.WriteLine(source.Sum(e => Math.Pow(e - ave, 2)) / source.Count()); | ||
// → 4.484375 | // → 4.484375 | ||
</ | </syntaxhighlight> | ||
<br><br> | <br><br> | ||
208行目: | 208行目: | ||
// { Name = Java, Age = 16}, | // { Name = Java, Age = 16}, | ||
// { Name = C#, Age = 11 }} | // { Name = C#, Age = 11 }} | ||
</ | </syntaxhighlight> | ||
<br><br> | <br><br> | ||
242行目: | 242行目: | ||
// Key=16, Source={{ Name = Java, Age = 16 }}, | // Key=16, Source={{ Name = Java, Age = 16 }}, | ||
// Key=8, Source={{ Name = Groovy, Age = 8 }, { Name = Scala, Age = 8 }}} | // Key=8, Source={{ Name = Groovy, Age = 8 }, { Name = Scala, Age = 8 }}} | ||
</ | </syntaxhighlight> | ||
<br><br> | <br><br> | ||
307行目: | 307行目: | ||
Console.WriteLine(outer.Zip(outer2, (o1, o2) => o1.Name + "&" + o2.Name).ToResult()); | Console.WriteLine(outer.Zip(outer2, (o1, o2) => o1.Name + "&" + o2.Name).ToResult()); | ||
// → {C#&Python, Java&COBOL} | // → {C#&Python, Java&COBOL} | ||
</ | </syntaxhighlight> | ||
<br><br> | <br><br> | ||
341行目: | 341行目: | ||
// → System.InvalidCastException: | // → System.InvalidCastException: | ||
// 型 'System.Double' のオブジェクトを型 'System.String' にキャストできません。 | // 型 'System.Double' のオブジェクトを型 'System.String' にキャストできません。 | ||
</ | </syntaxhighlight> | ||
<br><br> | <br><br> | ||
__FORCETOC__ | __FORCETOC__ | ||
[[カテゴリ:C_Sharp]] | [[カテゴリ:C_Sharp]] |