Click here to Skip to main content
15,892,480 members
Articles / Security / Encryption

Enhanced String Handling II

Rate me:
Please Sign up or sign in to vote.
3.76/5 (11 votes)
16 Dec 2010CPOL2 min read 36.2K   213   15  
Overcoming limitations of: Enhanced String Handling
using System;


namespace EnhancedStringEvaluate
{
	public interface IDelimitersAndSeparator
	{
		/// <summary>Original delimiter as user intended it to be</summary>
		string OpenDelimOrig { get; }
		string CloseDelimOrig { get; }

		/// <summary>A single character to be used in case OpenDelimOrig multi-character</summary>
		string OpenDelimAlternate { get; }
		string CloseDelimAlternate { get; }

		/// <summary>
		/// If OpenDelimOrig/CloseDelimOrig is a single character then use 
		/// original value or else use OpenDelimAlternate/CloseDelimAlternate
		/// </summary>
		string OpenDelimEquivalent { get; }
		string CloseDelimEquivalent { get; }

		/// <summary>
		/// Checks for balanced open-close symbol
		/// </summary>
		/// <param name="text"></param>
		/// <returns></returns>
		bool IsBalancedOpenClose(string text);

		/// <summary>
		/// A place for the system to transform the delimiters to their equivalent
		/// counterpart.
		/// </summary>
		/// <param name="text"></param>
		/// <returns></returns>
		string PreMatch(string text);

		/// <summary>
		/// A place for the system to transform the counterparts back to their
		/// original delimiters.
		/// </summary>
		/// <param name="text"></param>
		/// <returns></returns>
		string PostMatch(string text);

		/// <summary>Separator string</summary>
		string Separator { get; }

		/// <summary>Single character string alternate to the separator.  Used in a search for "not separator"</summary>
		string SeparatorAlternate { get; }

		/// <summary>Does text contains a simple construct</summary>
		/// <param name="text"></param>
		/// <returns></returns>
		bool IsSimpleExpression(string text);
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
avifarah@gmail.com

Comments and Discussions