strlen: Get and set the maximum string length of a character lvec

Description Usage Arguments Examples

View source: R/strlen.R

Description

Get and set the maximum string length of a character lvec

Usage

1
2
3
strlen(x)

strlen(x) <- value

Arguments

x

a lvec of type character.

value

the new value of the maximum string length.

Examples

1
2
3
4
5
6
7
8
a <- as_lvec('123')
strlen(a)  # = 3
# Strings are truncated to strlen
lset(a, 1, '123456')
print(a)  # '123'
strlen(a) <- 5
lset(a, 1, '123456')
print(a)  # '12345'

djvanderlaan/lvec documentation built on May 24, 2018, 6:25 p.m.