#pragma XOD dirtieness disable
node {
void evaluate(Context ctx) {
auto str = getValue<input_STR>(ctx);
unsigned char hex;
uint8_t result = 0;
for (auto it = str.iterate(); it; ++it) {
hex = *it;
if (hex != 0xd0 && hex != 0xd1) {
result++;
}
}
emitValue<output_LEN>(ctx, result);
}
}
STR | LEN |
---|---|
"" | 0 |
"Hello World!" | 12 |
"Привет World!" | 13 |
"Hello Мир!" | 10 |
"Привет Мир!" | 11 |