LENGTH() returns the number of characters in a specified string, including any leading or trailing blanks. This function is useful for string validation, data cleaning, and text analysis where you need to determine the size of a string.
LENGTH(string)
LENGTH() returns an integer value
LENGTH("APPLES") = 6 (counts all characters)
LENGTH(" APPLES ") = 8 (includes leading and trailing spaces)
LENGTH(TRIM(" APPLES ")) = 6 (spaces removed before counting)
LENGTH("") = 0 (empty string)
LENGTH(NULL) = NULL (NULL input)
LENGTH("Hello World") = 11 (includes space between words)