R String and Function Tools
Browse 68 R text, regex, formatting and encoding tools with live browser results, examples, and language references.
Many R text functions vectorize over a character vector. Set useBytes explicitly where the function supports it and byte matching matters. R reference
68 tools
No tools match.
Case & whitespace
- Camel caseConvert input to camelCase.
- Capitalize first characterUppercase the first character.
- Expand tabsReplace tab characters with spaces.
- Kebab caseConvert input to kebab-case.
- Left trimTrim the left side of input text.
- Lowercase first characterLowercase the first character.
- Right trimTrim the right side of input text.
- Sentence caseConvert words to sentence case.
- Snake caseConvert input to snake_case.
- Title caseUppercase first letter of each word.
- tolower()Convert text to lowercase.
- toupper()Convert text to uppercase.
- trimws()Trim leading and trailing whitespace or chosen characters.
- Word wrapWrap long text to a fixed width.
Search & replace
- Compare prefixCompare text prefix using a target value and length.
- Count occurrencesCount occurrences of a substring.
- First indexFind first index of a substring.
- Last indexFind last index of a substring.
- Remove prefixRemove a prefix if it exists.
- Remove suffixRemove a suffix if it exists.
- Replace textReplace target text with another value.
- Text from matchReturn text from first case-sensitive match.
- Text from match (case-insensitive)Return text from first case-insensitive match.
- Translate by mapApply character/string mapping replacements.
Split, join & measure
- Character frequenciesCount character/code point frequencies.
- Estimate syllable breaksApproximate syllable splitting for words.
- JoinJoin list-style input using a delimiter.
- nchar()Return the length of text input.
- Partition at first separatorSplit into (before, separator, after) at first separator.
- Partition at last separatorSplit into (before, separator, after) at last separator.
- Split into chunksSplit text into fixed-length chunks.
- Split linesSplit text into lines with optional line endings.
- strsplit()Split text using a delimiter and optional limit.
- substr()Extract a substring using start and optional length.
Encoding & escaping
- Base64 decodeDecode Base64 input to UTF-8 text.
- Base64 encodeEncode UTF-8 text as Base64.
- Character from numberCreate text from numeric code points.
- Character numberGet code point of first character.
- Decode HTML entitiesDecode HTML entities to text.
- Escape HTMLEscape text for safe HTML display.
- Hexadecimal to decimalConvert hexadecimal input to decimal text.
- Hexadecimal to textDecode hexadecimal input to text/bytes.
- Parse query stringParse query-string text into key/value output.
- ROT13Apply ROT13 substitution cipher.
- Strip tagsRemove HTML/XML tags from input.
- Text to hexadecimalConvert text bytes to hexadecimal.
- URI decodeDecode a full URI.
- URI encodeEncode a full URI.
- URL component decodeURL-decode a URI component.
- URL component encodeURL-encode a URI component.
Regex & parsing
Formatting & checksums
- Center textCenter text with fill characters.
- Format dateFormat date/timestamp values using tokens.
- Format numberFormat decimal values with separators.
- Format stringApply printf-style placeholders to arguments.
- Left justifyLeft-justify text to fixed width.
- Levenshtein distanceCompute edit distance to a target string.
- MD5 hashGenerate MD5 hash for text input.
- Pad endPad the end of a string.
- Pad startPad the start of a string.
- Pad stringPad text left/right/both to a target width.
- Right justifyRight-justify text to fixed width.
- SoundexGenerate soundex phonetic code.
- String similarityEstimate similarity ratio with a target string.
- Zero fillLeft-pad numeric text with zeros.