# ReadAllText(string)

> Reads all text from a file, resolving logical paths automatically.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.7/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public static string ReadAllText(string path)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Path to the file. Accepts logical and physical paths.

### Returns

| Type                                                           | Description                          |
| -------------------------------------------------------------- | ------------------------------------ |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | The entire file content as a string. |

### Remarks

Reads and returns the full text content of the file at `path`. Unlike `File.ReadAllText`, this method accepts logical paths directly without first converting them with [FileUtil.PathToAbsolutePath](/engine/6000.7/script-reference/unityeditor/fileutil/pathtoabsolutepath.md).

Throws ArgumentException when `path` is null or empty.

Additional Resources: [FileUtil.ReadAllLines](/engine/6000.7/script-reference/unityeditor/fileutil/readalllines.md), [FileUtil.ReadAllBytes](/engine/6000.7/script-reference/unityeditor/fileutil/readallbytes.md), [FileUtil.OpenRead](/engine/6000.7/script-reference/unityeditor/fileutil/openread.md)

### Examples

```csharp
using UnityEditor;
using UnityEngine;

public class ReadAllTextExample
{
    [MenuItem("Example/Read File Text")]
    static void ReadFileText()
    {
        string text = FileUtil.ReadAllText("Packages/com.example.package/Resources/config.json");
        Debug.Log(text);
    }
}
```
