Skip to content

Instantly share code, notes, and snippets.

@sinairv
sinairv / JoinAndSeparate.cs
Created December 17, 2011 15:51
Utilities for Joining and Separating a Set of Strings with a Specified Separator Character
/// <summary>
/// Separates the given compound string assuming that string components are separated
/// with the given separator character.
/// It is assumed that any usage of the separator character inside the compound string
/// is escaped with a backslash character, and any usage of the backslash character
/// is escaped with double backslash characters.
/// </summary>
/// <param name="compound">The compound string</param>
/// <param name="separator">The separator character</param>
/// <returns><c>List</c> of strings that built the original compound string</returns>