27 lines
665 B
C#
27 lines
665 B
C#
using System.Collections.Generic;
|
|
using System.IO;
|
|
|
|
namespace Core
|
|
{
|
|
public static class Extensions
|
|
{
|
|
public static string Canonicalize(this string s)
|
|
{
|
|
return s.ToUpperInvariant();
|
|
}
|
|
|
|
public static IEnumerable<string> GetFileLines(this string filename)
|
|
{
|
|
using (var sr = File.OpenText(filename))
|
|
{
|
|
while (true)
|
|
{
|
|
var line = sr.ReadLine();
|
|
if (line == null)
|
|
yield break;
|
|
yield return line;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |