Tag Archives: recursion

Find all Subdirectories from a given path using C#

To load the subdirectories for a given file path. We simply need to use the GetDirectories method of DirectoryInfo (this example loads the results into a listbox lstDirs) E.g. N.B. sPath needs to be a full path including drive letter … Continue reading

Posted in Programming | Tagged , , , , | Leave a comment

Remove ‘extra’ spaces in C # (C Sharp) string using recursion

This is a little code function that I developed to remove ‘extra’ spaces from a string.  I.e. removing any groups of two or more spaces. Basic theory is to replace all pairs of spaces with a single space, and keep … Continue reading

Posted in Programming | Tagged , , , | 2 Comments