String interpolation available for Studio

I’ve been waiting for this! Thank you so much, I can do so much more in my code now! :smile:

3 Likes

I will say that this is an interesting feature, it’s not something that I don’t think I will ever use. Reason being is that string.format follows C’s printf() string formatting which I’m used to because I use C extensively. However, with that being said, and judging from some of the other comments, I’m sure that others will find this useful.

3 Likes

This is a much needed feature, and I’ve wanted this for ages! Thank you kampfkarren, this will make formatting much easier!

4 Likes

It’s hard to see anything planned right now. What is your use case?

4 Likes

Sounds awesome! Definitely a quality quality-of-life feature.

3 Likes

If y’all are starting out 2023 with an update like this, this year is going to be amazing.

BRAVO :clap:t3::clap:t3::clap:t3:

5 Likes

way overdue but im glad its finally added

3 Likes

Personally I wouldn’t use it as I’m used to string formatting and I like it. I might make my own format though.

Very nice addition though, and congrats @Kampfkarren!

4 Likes

Oh my god, this was literally such a needed feature. Who would’ve thought we’ll get this feature this soon? But yeah, amazing job on making this possible :heart:

Congratulations @Kampfkarren :tada:

3 Likes

I’m happy to see such feature being added to Studio it is going to clean up way more

3 Likes

Finally! I’ve been waiting a LONG time for this one!

3 Likes

finally but this was a little too late

so what will be the type syntax for this?

Also, the forum should update their color thing now
IMG_20230105_102743

5 Likes

I never knew that you can use backticks for that like in JavaScript. Is this new?

2 Likes

It’s new syntax used for string interpolation.

You use backticks when you want to interpolate the string:

local balance = 5

print("You have {balance}!") -- You have {balance}!
print(`You have {balance}!`) -- You have 5!
5 Likes

OH MY GOD.

This is the best update we’ve had in years.
Bye bye string.format! (for most use cases)

2 Likes

Great work! Thank you Kampfkarren for getting this out there!

3 Likes

What do you mean by the type syntax?

1 Like

Will my script work as expected in live servers or is it just a studio beta?

2 Likes

Just studio, this doesn’t work in game yet and just gives you an error.

2 Likes

I fell in love with this when I was practicing C#. Almost time to ditch string.format. Thanks!

1 Like