public static void Move(string sourcePath, string targetPath) { string intermediatePath = GetFreshName(sourcePath, Enumerables.Create(sourcePath, targetPath)); MoveRaw(sourcePath, intermediatePath); MoveRaw(intermediatePath, targetPath); }
public static T Clamp <T>(this T value, T minimum, T maximum) where T : IComparable <T> { value = Enumerables.Create(value, minimum).Maximum(); value = Enumerables.Create(value, maximum).Minimum(); return(value); }
public static bool IsSubSuperScriptCompatible(this string text) { IEnumerable <char> allowedCharacters = Enumerables.Create(' ', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '-', '=', '(', ')'); return(!text.Except(allowedCharacters).Any()); }