Is there an equivalent to PHP strlen method in Ruby?
strlen
I know about the Ruby String#count method, but this requires a character set to be counted. In my situation, I want to count ALL characters, not just certain characters.
String#count
Use the String#size or String#length method. It will work for you.
String#size
String#length
Returns the length of the str. character str.
str.
Example:
"abc 12-".size # => 7
Source: https://habr.com/ru/post/970004/More articles:Correctly undo or undo PostAsync - c #Cancel POST request "HttpClient" - c #Error saving Eclipse project to Google Drive - google-plugin-eclipseWindows Phone 8.1 MediaElement Crash (exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) - c #Android: upload image to PHP server - androidWeb scraper without knowledge of page structure - pythonHow to βanswer doneβ in Gerrit when I refer to the comment code commentary on people - gerritBootstrap danger class not working for table row - cssGet NSData from NSOutputStream in memory? - iosHow to copy InputStream to AsynchronousFileChannel - javaAll Articles