Skip to main content
HttpMediaTypeHeaderValue.TryParse | tryParse method

Applies to Windows and Windows Phone

Determines whether a string is valid HttpMediaTypeHeaderValue information.

Syntax


var result = Windows.Web.Http.Headers.HttpMediaTypeHeaderValue.tryParse(input);
var mediaTypeHeaderValue = result.mediaTypeHeaderValue;
var boolean = result.boolean;

public static bool TryParse(
  string input, 
  out HttpMediaTypeHeaderValue mediaTypeHeaderValue
)

Public Shared Function TryParse(
  input As String,  
  <OutAttribute> ByRef mediaTypeHeaderValue As HttpMediaTypeHeaderValue 
) As Boolean

public:
static bool TryParse(
  String^ input, 
  [OutAttribute] HttpMediaTypeHeaderValue^ mediaTypeHeaderValue
)

Parameters

input

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The string to validate.

mediaTypeHeaderValue (out parameter)

Type: HttpMediaTypeHeaderValue

The HttpMediaTypeHeaderValue version of the string.

Return value

Type: Boolean [JavaScript] | System.Boolean [.NET] | Platform::Boolean [C++]

true if input is valid HttpMediaTypeHeaderValue information; otherwise, false.

Requirements

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Web.Http.Headers
Windows::Web::Http::Headers [C++]

Metadata

Windows.winmd

See also

HttpMediaTypeHeaderValue