MCPcopy Create free account
hub / github.com/apache/arrow-rs / num_chars

Method num_chars

arrow-array/src/array/string_array.rs:31–33  ·  view source on GitHub ↗

Returns the number of `Unicode Scalar Value` in the string at index `i`. # Performance This function has `O(n)` time complexity where `n` is the string length. If you can make sure that all chars in the string are in the range `U+0x0000` ~ `U+0x007F`, please use the function [`value_length`](#method.value_length) which has O(1) time complexity.

(&self, i: usize)

Source from the content-addressed store, hash-verified

29 /// If you can make sure that all chars in the string are in the range `U+0x0000` ~ `U+0x007F`,
30 /// please use the function [`value_length`](#method.value_length) which has O(1) time complexity.
31 pub fn num_chars(&self, i: usize) -> usize {
32 self.value(i).chars().count()
33 }
34
35 /// Returns an iterator that returns the values of `array.value(i)` for an iterator with each element `i`
36 pub fn take_iter<'a>(

Callers

nothing calls this directly

Calls 2

countMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected