Ruby provides a built-in function for checking the length of a string. Say it's called s : if s.length <= 25 # We're OK else # Too long end.
確定! 回上一頁