ES3.LoadRawString

public static string LoadRawString(string filePath, ES3Settings settings)

Description

Loads an entire file as a string.

It will use the text encoding in the default settings (UTF8 by default) unless an ES3Settings object with a different encoding is provided.

FileNotFoundException will be thrown if the file does not exist. In this case, you can use ES3.FileExists to check if the data exists before loading.

Important: this method should not be used to load data which does not having a text encoding. For example, encrypted data is not encoded and trying to load it as a string will corrupt it. For unencoded data you should use LoadRawBytes instead.

Parameters

filePath The relative or absolute path of the file we want to load the raw string from.

settings

[Optional] The settings we want to use to override the default settings.

Returns

The loaded file as a string, using the encoding specified in the settings.

Examples

C#

JS