function google_plusone_trim in Google Plus One Button | Google+ Badge 7
Same name and namespace in other branches
- 6 google_plusone.admin.inc \google_plusone_trim()
Helper function to trim whitespace and make sure to remove the last character if it is a delimiter.
Parameters
$list: A string representing a list of items
$delimiter: A string that contains a delimiter.
Return value
A whitespace-trimmed string
2 calls to google_plusone_trim()
File
- ./
google_plusone.admin.inc, line 203 - Administration page for the Google +1 Button.
Code
function google_plusone_trim($list, $delimiter) {
$list = trim(check_plain($list));
if (!empty($list)) {
if (drupal_substr($list, -1) === $delimiter) {
$list = drupal_substr($list, 0, -1);
}
}
return $list;
}