Method StringFromUrlOrNull
StringFromUrlOrNull(string, Encoding?)
Loads a string from the specified resource URL or returns null if failed.
public static string? StringFromUrlOrNull(string url, Encoding? encoding = null)
Parameters
urlstringThe resource URL used to load the data.
encodingEncodingThe encoding to use for reading the stream. Optional. If not specified, UTF8 is used.
Returns
- string
The string loaded from the URL, or
nullif an error occurs.