Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Text values
Variables
Functions
21. Number of characters in string
Summary

Instruction

Nice work! Until now, we've dealt with functions that work with numbers. However, there are also functions that can take text values as arguments and return some value. One of such function is nchar. The function nchar calculates the number of characters (not just letters) in a string. In other words, it finds the length of a particular string. For example:

nchar("Mary ")
will return 5, and
nchar("Tim")
will return 3.

Exercise

How many characters are contained in the longest English word, pneumonoultramicroscopicsilicovolcanoconiosis? Use an appropriate function call to answer this question. Remember to pass this word in as a string.