# How to convert FString to const TCHAR?

**URL:** <https://forums.unrealengine.com/t/how-to-convert-fstring-to-const-tchar/340681>\
**Category:** UI\
**Tags:** fstring, casting, text, unreal-engine, question\
**Created:** [December 6, 2015, 5:36pm UTC](https://forums.unrealengine.com/t/how-to-convert-fstring-to-const-tchar/340681 "2015-12-06T17:36:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thumper](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thumper](https://forums.unrealengine.com/u/Thumper)\
**Post date:** [December 6, 2015, 5:36pm UTC](https://forums.unrealengine.com/t/how-to-convert-fstring-to-const-tchar/340681/1 "2015-12-06T17:36:15Z")

</div>

I’m trying to use:

```
Cast<UStaticMesh>(StaticLoadObject(UStaticMesh::StaticClass(), NULL, TEXT("StaticMesh'/Game/Environment/Floor/StaticMeshes/Hex_Water.Hex_Water'")))

```

and I have an array of FStrings of the file locations for all the uassets in that folder. I would like plug the FString information into the spot where it’s asking for the directory location :

```
TEXT("StaticMesh'/Game/Environment/Floor/StaticMeshes/Hex_Water.Hex_Water'")

```

But when I try to I get an error saying I cannot convert FString to const TCHAR \*

I tried FText::FromString(output[0])

but it then says can’t convert from FText to TCHAR \*.

---

<div class="post-metadata">

**Author:** ![Thumper](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thumper](https://forums.unrealengine.com/u/Thumper)\
**Post date:** [December 6, 2015, 5:44pm UTC](https://forums.unrealengine.com/t/how-to-convert-fstring-to-const-tchar/340681/2 "2015-12-06T17:44:22Z")

</div>

Meh, I found the answer here. I needed to dereference the FString \*output[0]

Here’s the [post](https://answers.unrealengine.com/questions/4459/convert-fstring-to-text.html)

---

<div class="post-metadata">

**Author:** ![FanOfUE](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FanOfUE](https://forums.unrealengine.com/u/FanOfUE)\
**Post date:** [October 29, 2019, 2:57am UTC](https://forums.unrealengine.com/t/how-to-convert-fstring-to-const-tchar/340681/3 "2019-10-29T02:57:25Z")

</div>

The \* operator on FStrings returns their TCHAR\* data which is what FCString functions use.
