️ implement formatting of settings values on import and export

This commit is contained in:
Marc Michalsky forumZFD 2021-04-12 11:44:11 +02:00
parent 0d9b312a9b
commit 0b1128fce5
Signed by untrusted user who does not match committer: marc.koch
GPG key ID: 12406554CFB028B9
6 changed files with 436 additions and 59 deletions

View file

@ -51,4 +51,24 @@ class CRM_TwingleCampaign_Utils_StringOperations {
}
return $string;
}
/**
* Checks if a string ands with another string.
* @param $haystack
* @param $needle
* @return bool
*/
public static function endsWith($haystack, $needle): bool {
return substr_compare($haystack, $needle, -strlen($needle)) === 0;
}
/**
* Checks if a string starts with another string.
* @param $haystack
* @param $needle
* @return bool
*/
public static function startsWith($haystack, $needle): bool {
return substr_compare($haystack, $needle, 0, strlen($needle)) === 0;
}
}