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

[table th=”0″]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.”[/table]

Returns

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

Examples

C#

// Load the file myFile.es3 as a string.
string str = ES3.LoadRawString("myFile.es3");

JS

// Load the file myFile.es3 as a string.
var str : String = ES3.LoadRawString("myFile.es3");