str_detect_unbalanced: Detect unbalanced (quotes)

Description Usage Arguments Details Value References Examples

View source: R/str_detect_unbalanced.R

Description

Detects whether strings contain unbalanced quites

Usage

1
str_detect_unbalanced(string, quotes = c("'", "\""))

Arguments

string

character; string

quotes

character; characters used for quiting

Details

Determines whether there are unb Unbalanced quotes are determined by an odd number of quotes once all escaped quotes are removed.

Value

logical

References

Stackoverflow

Examples

1
2
3
4
5
  str_detect_unbalanced( character(0) ) # locical(0)
  str_detect_unbalanced( "" )           # FALSE
  str_detect_unbalanced( "'" )          # TRUE

  "foo \\' bar" %>% cat

decisionpatterns/stringr.tools documentation built on Nov. 4, 2019, 10:24 a.m.