construct_bstr: Constructer of the bstr class object

Description Usage Arguments Examples

Description

Constructer of the bstr class object

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
bstr(x, n, ucase = FALSE)

dstr(x, n, ucase = FALSE)

pstr(x, n, ucase = FALSE)

is_bstr(x)

is_dstr(x)

is_pstr(x)

as_bstr(x, n, ucase = FALSE)

as_dstr(x, n, ucase = FALSE)

as_pstr(x, n, ucase = FALSE)

Arguments

x

A character vector which convert to a bstr object.

n

A character vector which is name of x.

ucase

A logical. If TRUE the x is converted to upper case. (default: FALSE)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
bstr("Apple", "apple")
bstr(c("Apple", "potato"), c("apple", "imo"), ucase = TRUE)

dstr("A.Bad.bat", "It is")
dstr(c("A", "bad", "Bat"), ucase = TRUE)

pstr("Wqrld", "HELLQ", ucase = TRUE)

### Check class
is_bstr(bstr("apple"))
is_bstr(c("apple", "orange"))
is_dstr(dstr("bad"))
is_pstr(pstr("I.am.a.geek"))

### Convert character to bstr object
as_dstr("bad", "good", ucase = TRUE)
# as_dstr(c("good", "bad")) # Error
as_pstr("Wqrld", "HELLQ", ucase = TRUE)

t-arae/bstringr documentation built on March 18, 2021, 3:08 a.m.