Cornerstone.Tools.Translate.Translator.ResponseClean C# (CSharp) Méthode

ResponseClean() private méthode

private ResponseClean ( string response ) : string
response string
Résultat string
        private string ResponseClean(string response)
        {
            Regex reg = new Regex(@"translatedText.{3}(?<translatedText>[^}]+)""}");
            Match match = reg.Match(response);
            string cleanedResponse = match.Groups["translatedText"].Value;
            cleanedResponse = HttpUtility.HtmlDecode(cleanedResponse.Replace(@"\u0026", "&"));
            cleanedResponse = cleanedResponse.Replace(@"\", "");
            if (cleanedResponse.Contains("detectedSourceLanguage")) {
                cleanedResponse = cleanedResponse.Remove(cleanedResponse.LastIndexOf("detectedSourceLanguage") - 3);
            }
            if (_debug) logger.Debug("Translation tool: Cleaned Translation: {0}", cleanedResponse);
            return cleanedResponse;
        }