Skip to contents

strlength splits the input string into individual characters and counts them using strsplit and length. It is equivalent to determining the string length.

Usage

strlength(x)

Arguments

x

A character string. The input string whose length is to be calculated.

Value

An integer. The total number of characters in the input string.

Details

This function calculates the total number of characters in a given string.

Examples

# Example usage:
strlength("hello")        # Returns: 5
#> [1] 5
strlength("R is great!")  # Returns: 11
#> [1] 11