How to add Spacing between lower and upper case characters with C#
To to add Spacing between lower and upper case characters i first loop though the string and get all upper case characters and add them to
a list if the upper case character does not follow an upper character eg : ABCdef will out put ABC def.
public static string AddSpacesToSentence(this string text)
How to Split a String with another String with C#
To split a string with another string simply use the split method and pass in a new string array with the string to split.
How to get split a String in to individual lines with C#
To get individual lines from a string first replace all carriage returns with /r with an empty string or "" then split the string with \n or Environment.NewLine and this will return
an array for each line.
public static string GetLines(this string text) => text.Replace("\r", "").Split('\n');
How to file size as a readable string with C#
To get the file size first use FileInfo and give it the file path then get the length this will return as a long.
then pass the long to the method BytesToString and this will return a readable string.
return new FileInfo(FilePath).Length.BytesToString();