Pass the path if there are environmental variables exist in the path then it will be collapsed into a valid path and return the valid path.Constants :-public const string PATH_SEPARATOR = @"\";public const string ENVIROMENT_VARIABLE_FORMAT = "%{0}%";public static string CollapseEnviromentVariables(string pathString) { string result...
How to allign multiple strings using seperator in C# ?
Constant file.public const char SYMBOL_SPACE_CHARACTER = ' ';public static List AlignText(string[] strings, char seperator) { List formattedStringList = new List(); List ListOfCommaSeperatedStringsInLine = new List(); string[] commaSeperatedStringsArray = null; List maxColumnWidthArray = new List(); //split strings into list of comma seperated...
How to check invalid characters in path using C#
If you create a new folder then there are some characters which are not allowed and any thing in which user have rights to create path then firstly check the invalid characters otherwise your application or program will through an exception.Pass the path or string for which you have to check.public static bool CheckInvalidCharacters(string path){ ...