R.apex

  • Docs
  • Tutorials
Docs Menu
  • Func
  • R.Funcs
    • Conversion Funcs
    • Arithmetic Funcs
    • Logic Funcs
    • Relation Funcs
    • Function Funcs
    • Comparator Funcs
    • Condition Funcs
    • List Funcs
    • String Funcs
    • Map Funcs
    • Utility Funcs
    • Database Funcs
  • R.Instance
    • Creation Methods
    • Conversion Methods
    • Methods

String Funcs Guide

String Funcs in R

capitalize

Capitalize the string.

R.capitalize.run('cat')
// Cat

match

Check regex match.

R.match.run('.*(a).*', 'cat')
// (cat, a)

pad

Pad the string to the length, with given padding.

R.pad.run(5, '*', 'cat')
// *cat*

padLeft

Pad the string to the left to the length, with given padding.

R.pad.run(5, '*', 'cat')
// **cat

padRight

Pad the string to the right to the length, with given padding.

R.pad.run(5, '*', 'cat')
// cat**

replace

Replace the string with replacement, only for the first occurrence of the matching.

R.replace.run('cat', 'dog', 'I love cats')
// I love dogs

replaceAll

Replace the string with replacement, for all occurrences of the matching.

R.replaceAll.run('cat', 'dog', 'I love cats')
// I love dogs

split

Split the string into a list.

R.split.run(' ', 'a b c')
// (a, b, c)

test

Test for the string matching.

R.test.run('.*a.*', 'cat')
// true

toLower

Convert the string into lowercase.

R.toLower.run('ABC')
// abc

toUpper

Convert the string into uppercase.

R.toUpper.run('abc')
// ABC

trim

Trim the string.

R.trim.run(' abc ')
// abc

Contribute on Github! Edit this section.