sdk/dotnet/src/Microsoft.Datasync.Client/Http/HttpMessageExtensions.cs
/// <summary>
/// Converts a string to a quoted ETag value.
/// </summary>
/// <param name="value">The version string to convert.</param>
/// <returns>The converted value.</returns>
Converts a string to a quoted ETag value.
Converts a string to a quoted ETag value .
internal static string ToETagValue(this string value)
        {
            if (string.IsNullOrEmpty(value))
            {
                return null;
            }
            for (int i = 0; i < value.Length; i++)
            {
                if (value[i] == '"' && (i == 0 || value[i - 1] != '\\'))
                {
                    value = value.Insert(i, "\\");
                }
            }
            return $"\"{value}\"";
        }
internal static string ToETagValue ( this string value ) { if ( string . IsNullOrEmpty ( value ) ) { return null ; } for ( int i = 0 ; i < value . Length ; i ++ ) { if ( value [ i ] == ' ' && ( i == 0 || value [ i - 1 ] != ' \\ ' ) ) { value = value . Insert ( i , " \\ " ) ; } } return $" \" { value } \" " ; }
Converts a string to a quoted ETag value.
Converts a string to a quoted ETag value .
The converted value.
The converted value .
string
this
value
The version string to convert.
The version string to convert .