string.RemoveWhitespace()

Here are the examples of the csharp api string.RemoveWhitespace() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

19 Source : StringExtensions.cs
with MIT License
from Azure

public static byte[] ToBody(this string input) =>
            Encoding.UTF8.GetBytes(input.RemoveWhitespace().SingleToDoubleQuotes());

19 Source : PemHelper.cs
with MIT License
from glennawatson

private static (string header, byte[] body, string footer) ExtractPemParts(string pem)
        {
            var match = Regex.Match(pem, @"^(?<header>\-+\s?BEGIN[^-]+\-+)\s*(?<body>[^-]+)\s*(?<footer>\-+\s?END[^-]+\-+)\s*$");
            if (!match.Success)
            {
                throw new InvalidOperationException(Resources.InvalidPemEncoding);
            }

            var header = match.Groups["header"].Value;
            var bodyText = match.Groups["body"].Value.RemoveWhitespace();
            var footer = match.Groups["footer"].Value;

            var body = Convert.FromBase64String(bodyText);

            return (header, body, footer);
        }