DataUrl.GetMediaType Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| GetMediaType(String) |
Extracts the media type from a data URL string
(e.g., returns |
| GetMediaType(Uri) |
Extracts the media type from a data URL Uri
(e.g., returns |
GetMediaType(String)
- Source:
- DataUrl.cs
Extracts the media type from a data URL string
(e.g., returns "text/plain" from data:text/plain;base64,...).
public static string? GetMediaType(string? dataUrl);
static member GetMediaType : string -> string
Public Shared Function GetMediaType (dataUrl As String) As String
Parameters
- dataUrl
- String
A data URL string.
Returns
The media type string, or null if the string is not a data URL or has no media type.
Applies to
GetMediaType(Uri)
- Source:
- DataUrl.cs
Extracts the media type from a data URL Uri
(e.g., returns "image/png" from data:image/png;base64,...).
public static string? GetMediaType(Uri? uri);
static member GetMediaType : Uri -> string
Public Shared Function GetMediaType (uri As Uri) As String
Parameters
- uri
- Uri
A data URL.
Returns
The media type string, or null if the URI is not a data URL or has no media type.