I’m doing some string manipulation and I need a method of getting the length of the string. So I used the #
operator. Later on, when browsing the API documentation of the string
methods, I found this method called string.len
. It gives this description:
Receives a string and returns its length.
That means it has the same usage as the #
operator, right? So here is my question:
- What are the advantages of
string.len
over the#
operator (and vice-versa)?
Looking forward to your answers!!