Share via


DataContent.HasTopLevelMediaType(String) Method

Definition

Determines whether the MediaType's top-level type matches the specified topLevelType.

public:
 bool HasTopLevelMediaType(System::String ^ topLevelType);
public bool HasTopLevelMediaType(string topLevelType);
member this.HasTopLevelMediaType : string -> bool
Public Function HasTopLevelMediaType (topLevelType As String) As Boolean

Parameters

topLevelType
String

The type to compare against MediaType.

Returns

true if the type portion of MediaType matches the specified value; otherwise, false.

Remarks

A media type is primarily composed of two parts, a "type" and a "subtype", separated by a slash ("/"). The type portion is also referred to as the "top-level type"; for example, "image/png" has a top-level type of "image". HasTopLevelMediaType(String) compares the specified topLevelType against the type portion of MediaType.

Applies to