Strip balanced quotes from around a string (assumes already trimmed)
| 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) { |