Castle.MonoRail.Views.Brail.BrailPreProcessor.UnescapeInitialAndClosingDoubleQuotes C# (CSharp) Méthode

UnescapeInitialAndClosingDoubleQuotes() public static méthode

public static UnescapeInitialAndClosingDoubleQuotes ( string code ) : string
code string
Résultat string
		public static string UnescapeInitialAndClosingDoubleQuotes(string code)
		{
			if (code.StartsWith(ClosingQuoteReplacement))
				code = DoubleQuote + code.Substring(ClosingQuoteReplacement.Length);
			if (code.EndsWith(ClosingQuoteReplacement))
				code = code.Substring(0, code.Length - ClosingQuoteReplacement.Length) +
					   DoubleQuote;
			return code;
		}
	}

Usage Example

        private static void UnescapeInitialAndClosingDoubleQuotes(MacroStatement macro)
        {
            var value = macro.Arguments[0] as StringLiteralExpression;

            if (value == null)
            {
                return;
            }
            value.Value = BrailPreProcessor.UnescapeInitialAndClosingDoubleQuotes(value.Value);
        }