Learn R Programming

evalR (version 0.0.1)

find_parenthesis: Helper to find first block of parenthesis

Description

This function will search for the first block of parenthesis and return it if found. Otherwise, it will return "".

Usage

find_parenthesis(text)

Value

a substring. Either "" or the first parenthesis block.

Arguments

text

the string/code/statement you want to parse.

Examples

Run this code
# returns ""
find_parenthesis("3 + 5")
# returns "(3 + 5)"
find_parenthesis("2 * (3 + 5)")

Run the code above in your browser using DataLab