MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / stripQuotes

Function stripQuotes

src/attributes.cpp:3090–3096  ·  view source on GitHub ↗

Strip balanced quotes from around a string (assumes already trimmed)

Source from the content-addressed store, hash-verified

3088
3089 // Strip balanced quotes from around a string (assumes already trimmed)
3090 void stripQuotes(std::string* pStr) {
3091 if (pStr->length() < 2)
3092 return;
3093 char quote = *(pStr->begin());
3094 if ( (quote == '\'' || quote == '\"') && (*(pStr->rbegin()) == quote) )
3095 *pStr = pStr->substr(1, pStr->length()-2); // #nocov
3096 }
3097
3098 // is the passed string quoted?
3099 bool isQuoted(const std::string& str) {

Callers 1

ParamMethod · 0.85

Calls 2

lengthMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected