From 8955358fcc6fed514b9f8b6e8b8eab5169591e89 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 4 Apr 2007 00:49:11 +0000 Subject: [PATCH] Added BSFunctions::Substring() that doesn't take in a length, but rather an end position --- Functions.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Functions.php b/Functions.php index e1ed529..340b9e9 100644 --- a/Functions.php +++ b/Functions.php @@ -711,6 +711,23 @@ class BSFunctions return implode("\n", $calls); } + + // ################################################################### + /** + * A variation of PHP's substr() method that takes in the start + * and end position of a string, rather than a start and length. This + * mimics Java's String.substring() method. + * + * @param string The string + * @param integer Start position + * @param integer End position + * + * @return string Part of a string + */ + public static function Substring($string, $start, $end) + { + return substr($string, $start, $end - $start); + } } /*=====================================================================*\ -- 2.43.5