getBytes.String: Converts the string into a vector of bytes

Description Usage Value Author(s) See Also Examples

Description

Converts the string into a vector of bytes (integers) according to the ASCII table.

Usage

1
2
## S3 method for class 'String'
getBytes(this, ...)

Value

Returns a vector of integers in the range [0,255]. If the string is empty an empty vector is returned.

Author(s)

Henrik Bengtsson (http://www.braju.com/R/)

See Also

*toCharArray(), charToInt, intToChar

Examples

1
2
3
  s <- String("Hello world!")
  bfr <- getBytes(s)  # c(72,101,108,108,111,32,119,111,114,108,100,33)
  bfr <- getBytes("Hello world!")

HenrikBengtsson/R.lang documentation built on May 8, 2019, 7:50 p.m.