Castle.MonoRail.Views.Brail.BrailPreProcessor.UnescapeInitialAndClosingDoubleQuotes C# (CSharp) Method

UnescapeInitialAndClosingDoubleQuotes() public static method

public static UnescapeInitialAndClosingDoubleQuotes ( string code ) : string
code string
return 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

コード例 #1
0
        private static void UnescapeInitialAndClosingDoubleQuotes(MacroStatement macro)
        {
            var value = macro.Arguments[0] as StringLiteralExpression;

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