EVOLUTION-MANAGER
Edit File: stri_numbytes.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Count the Number of Bytes</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for stri_numbytes {stringi}"><tr><td>stri_numbytes {stringi}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Count the Number of Bytes</h2> <h3>Description</h3> <p>Counts the number of bytes needed to store each string in the computer's memory. </p> <h3>Usage</h3> <pre> stri_numbytes(str) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>str</code></td> <td> <p>character vector or an object coercible to</p> </td></tr> </table> <h3>Details</h3> <p>Often, this is not the function you would normally use in your string processing activities. See <code><a href="stri_length.html">stri_length</a></code> instead. </p> <p>For 8-bit encoded strings, this is the same as <code><a href="stri_length.html">stri_length</a></code>. For UTF-8 strings, the returned values may be greater than the number of code points, as UTF-8 is not a fixed-byte encoding: one code point may be encoded by 1-4 bytes (according to the current Unicode standard). </p> <p>Missing values are handled properly. </p> <p>The strings do not need to be re-encoded to perform this operation. </p> <p>The returned values do not include the trailing NUL bytes, which are used internally to mark the end of string data (in C). </p> <h3>Value</h3> <p>Returns an integer vector of the same length as <code>str</code>. </p> <h3>See Also</h3> <p>Other length: <code><a href="stri_isempty.html">stri_isempty</a>()</code>, <code><a href="stri_length.html">stri_length</a>()</code>, <code><a href="stri_width.html">stri_width</a>()</code> </p> <h3>Examples</h3> <pre> stri_numbytes(letters) stri_numbytes(c('abc', '123', '\u0105\u0104')) ## Not run: # this used to fail on Windows, as there was no native support for 4-bytes # Unicode characters; see, however, stri_escape_unicode(): stri_numbytes('\U7fffffff') # compare stri_length('\U7fffffff') ## End(Not run) </pre> <hr /><div style="text-align: center;">[Package <em>stringi</em> version 1.4.6 <a href="00Index.html">Index</a>]</div> </body></html>