Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
str.length() and str.size() can be used interchangeably to obtain the length or size of a string, and there is no functional difference between them. You can choose whichever form you find more suitable or preferable in your code.
i mean the length() function is a member function of the std::basic_string class and is inherited by the std::string class, and size() is a synonym for length() in the std::string class. It is provided to make the code more readable and intuitive since "size" conveys the same meaning as "length" in the context of a strng hope it helped my guy
what's the difference between
str.length()
andstr.size()
?This is the best pratice? 🤔
https://en.cppreference.com/w/cpp/string/basic_string/substr
I had to manually fix it by removing the local on the function in the initial solution setup. Both of our solutions seem to have taken that "local" out, but it does indeed cause a compilation error if I open a new Lua solution and try to run it.
I disagree. Doesnt it work?
In Lua the function isn't exported to the tests properly by default because it's marked as local.
This solution has a typo where it checks for "thridFlag" instead of "thirdFlag"