view dmd/Escape.d @ 151:766e6dc390e1

+ Escape.escapeChar()
author Trass3r
date Wed, 15 Sep 2010 02:47:24 +0200
parents 10317f0c89a5
children
line wrap: on
line source

module dmd.Escape;

struct Escape
{
	string[256] strings;

	/***************************************
	 * Find character string to replace c with.
	 */
	static string escapeChar(char c)
	{
		switch (c)
		{
		case '<':
			return "&lt;";
		case '>':
			return "&gt;";
		case '&':
			return "&amp;";
		default:
			return null;
		}
	}
}