Skip to tool

R Compare prefix Online

Compare text prefix using a target value and length.

The output updates as you type. The tool processes input in your browser.

Worked example

Compare the first N units of each value. Negative, zero, and positive results indicate ordering.

Prefix
"manual"
Length
6
Sample input
manuals
Sample output
0

Using this operation in R

The interactive result uses JavaScript. Many R text functions vectorize over a character vector. Set useBytes explicitly where the function supports it and byte matching matters.

R reference