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
url
stringThe resource URL used to load the data.
encoding
EncodingThe encoding to use for reading the stream. Optional. If not specified, UTF8 is used.
Returns
- string
The string loaded from the URL, or
null
if an error occurs.