What are string methods in C++

It is not clear what are the supported string methods in C++. The code provided for completion simply fails with undefined methods, see below for “Loud Quietness”. Some of the methods do work tough, e.g. s.size(). Is there a definition of string class somewhere? Can please point me to it?

auto password = "abcdef"; 
hero.say(password.toUpperCase()); // <---- This fails with : "password.toUpperCase() is not a function"

Vlad and Ron

1 Like

Welcome back @vladin !
I think you just need to remove the

behind the password. Anyway it worked for me :slightly_smiling_face: . Im no expert at C++ so you might wanna ask the @staff for clarification. (sry for the ping)

I just copied my code using hero.say() merely for debugging. I actually need the upper case - this is the main point and it is failing with error above.

I don’t think you can use var.toUpperCase in CC
I tried it in python and it doesn’t work

It won’t work in Python.
Var is for javascript.

No, I meant the variable like

var = "kookies"

He’s using c++ i think

isnt that java script?(Also maybe the :hero.say(var.toUpperCase),might work).

I am using C++. The code calling this method is not mine, it is there when the problem “Loud Quietness” starts. It just does not compile.


@nick are there any plans to fix the string methods for CPP and Java soon?

I think we should add suitable functions inline in the sample code for those levels that the player can use, rather than relying on built-ins that are different. We can also edit the documentation to be different for those languages.

It would be cool if there was a setting for optional language-specific documentation in the level editor. Or, we can manually edit all of the levels.