MCPcopy Index your code
hub / github.com/endbasic/endbasic / slice_by_char_range

Function slice_by_char_range

std/src/strings.rs:92–96  ·  view source on GitHub ↗

Returns the substring of `s` within the given character range.

(s: &str, start: usize, end: usize)

Source from the content-addressed store, hash-verified

90
91/// Returns the substring of `s` within the given character range.
92fn slice_by_char_range(s: &str, start: usize, end: usize) -> &str {
93 let start = char_index_to_byte_index(s, start);
94 let end = char_index_to_byte_index(s, end);
95 &s[start..end]
96}
97
98/// Parses the numeric prefix in `s` according to BASIC's `VAL` rules.
99fn parse_numeric_prefix(s: &str) -> f64 {

Callers 1

execMethod · 0.85

Calls 1

char_index_to_byte_indexFunction · 0.85

Tested by

no test coverage detected