# How do I implement String to string?

**URL:** <https://forum.juce.com/t/how-do-i-implement-string-to-string/22186>\
**Category:** General JUCE discussion\
**Created:** [May 2, 2017, 4:11am UTC](https://forum.juce.com/t/how-do-i-implement-string-to-string/22186 "2017-05-02T04:11:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgtsmokey86](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@sgtsmokey86](https://forum.juce.com/u/sgtsmokey86)\
**Post date:** [May 2, 2017, 4:11am UTC](https://forum.juce.com/t/how-do-i-implement-string-to-string/22186/1 "2017-05-02T04:11:51Z")

</div>

I have a string:

```
Juce::String Foo;

```

and I can’t work out how to implement this:

```
std::string toStdString () const

```

i have tried numerous things such as things like this

```
std::string bar = juse::Foo.toStdString();

```

but haven’t prevailed. Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![matkatmusic](https://avatars.discourse-cdn.com/v4/letter/m/dfb087/32.png) [@matkatmusic](https://forum.juce.com/u/matkatmusic)\
**Post date:** [May 2, 2017, 5:14am UTC](https://forum.juce.com/t/how-do-i-implement-string-to-string/22186/2 "2017-05-02T05:14:13Z")

</div>

```
String foo("my foo string");
std::string fooStd = foo.toStdString();

```

or

```
std::string fooStd = String("my foo string").toStdString();

```

seems like you might be missing some basic knowledge of how c++ works and how to read/work with APIs

---

<div class="post-metadata">

**Author:** ![sgtsmokey86](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@sgtsmokey86](https://forum.juce.com/u/sgtsmokey86)\
**Post date:** [May 2, 2017, 9:59am UTC](https://forum.juce.com/t/how-do-i-implement-string-to-string/22186/3 "2017-05-02T09:59:02Z")

</div>

Thanks dude.

I am a computer science student, C++ was first year, haven’t touched it this year until now. This year has been Java and C#.

By time I think I grasp one, we get told to do another. Can’t wait to finish and concentrate one one and become pro like you 🙂
