ES3.LoadRawString
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.
A 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#
1 2 |
// Load the file myFile.es3 as a string. string str = ES3.LoadRawString("myFile.es3"); |
JS
1 2 |
// Load the file myFile.es3 as a string. var str : String = ES3.LoadRawString("myFile.es3"); |