TRIMNONPRINTABLE

@param    mixed    $stringValue    Value to check
@return    string
325861
public static function TRIMNONPRINTABLE($stringValue = '')
    {
        $stringValue    = PHPExcel_Calculation_Functions::flattenSingleValue($stringValue);

        if (is_bool($stringValue)) {
            return ($stringValue) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
        }

        if (self::$invalidChars == null) {
            self::$invalidChars = range(chr(0), chr(31));
        }

        if (is_string($stringValue) || is_numeric($stringValue)) {
            return str_replace(self::$invalidChars, '', trim($stringValue, "\x00..\x1F"));
        }
        return null;
    }
540007
protected function _processFilter($fieldValue)
    {
        $stringModifier = getStr();

        //removing % symbols
        $fieldValue = $stringModifier->preg_replace("/^%|%$/", "", trim($fieldValue));

        return $stringModifier->preg_replace("/\s+/", " ", $fieldValue);
    }
357012
public static String removeIndentation(String rawValue) {
        String[] lines = rawValue.split("\\n");
        Integer commonIndent = null;
        for (int i = 0; i < lines.length; i++) {
            if (i == 0) continue;
            String line = lines[i];
            int length = line.length();
            int indent = leadingWhitespace(line);
            if (indent < length) {
                if (commonIndent == null || indent < commonIndent) {
                    commonIndent = indent;
                }
            }
        }
        List<String> lineList = new ArrayList<>(Arrays.asList(lines));
        if (commonIndent != null) {
            for (int i = 0; i < lineList.size(); i++) {
                String line = lineList.get(i);
                if (i == 0) continue;
                if (line.length() > commonIndent) {
                    line = line.substring(commonIndent);
                    lineList.set(i, line);
                }
            }
        }
        while (!lineList.isEmpty()) {
            String line = lineList.get(0);
            if (containsOnlyWhiteSpace(line)) {
                lineList.remove(0);
            } else {
                break;
            }
        }
        while (!lineList.isEmpty()) {
            int endIndex = lineList.size() - 1;
            String line = lineList.get(endIndex);
            if (containsOnlyWhiteSpace(line)) {
                lineList.remove(endIndex);
            } else {
                break;
            }
        }
        StringBuilder formatted = new StringBuilder();
        for (int i = 0; i < lineList.size(); i++) {
            String line = lineList.get(i);
            if (i == 0) {
                formatted.append(line);
            } else {
                formatted.append("\n");
                formatted.append(line);
            }
        }
        return formatted.toString();
    }
845864
protected function generateTextarea($options, $currentValue = null)
    {
        $value = is_null($currentValue) ? $options['value'] : $currentValue;

        unset($options['value']);
        unset($options["type"]);

        return sprintf('<textarea %s>%s</textarea>', $this->arrayToHtmlAttributes($options), stripslashes($value));
    }
801198
public static String trim(final String value, final boolean trimmed) {
        if(!trimmed || value == null) {
            return value;
        }

        return value.trim();

    }
929992
public function trimLeft( $string, $needle, $caseSensitive = true )
	{
		$strPos = $caseSensitive ? "strpos" : "stripos";
		if( $strPos( $string, $needle ) === 0 ) {
			$string = substr( $string, strlen( $needle ));
		}
		return $string;
	}
1032191
public function trim($char = null)
    {
        if ($this->isNull($char)) {
            $value = trim($this->val());
        } else {
            if (!$this->isString($char)) {
                throw new StringObjectException(StringObjectException::MSG_INVALID_ARG, [
                    '$char',
                    'string'
                ]);
            }

            $value = trim($this->val(), $char);
        }

        $this->val($value);

        return $this;
    }
1372960
public static function fromString($stringValue)
    {
        $stringValue = strtolower($stringValue);

        if (in_array($stringValue, static::$letters, true)) {
            return static::getValueFromLetter($stringValue);
        }

        if (in_array($stringValue, static::$symbols, true)) {
            return static::getValueFromSymbol($stringValue);
        }

        throw CardException::unexpectedSuit($stringValue);
    }
281066
private function stringify($attributeValue)
    {
        if (is_object($attributeValue) && get_class($attributeValue) == "SAML2\XML\saml\NameID") {
            return $attributeValue->NameQualifier . '!' . $attributeValue->SPNameQualifier . '!'
                . $attributeValue->value;
        } else {
            return $attributeValue;
        }
    }
145054
private static function getValueFromLetter($stringValue): Suit
    {
        $values = array_values(static::$letters);
        $key = array_search($stringValue, $values, true);

        return static::makeSuit($key + 100);
    }
1163088
public static function trim($string, $charlist = '\s\xA0')
    {
        $string = str_replace('&nbsp;', ' ', $string);

        return trim(preg_replace('@^[' . $charlist . ']+(.*)[' . $charlist . ']+$@u', '\\1', $string));
    }
424062
public static function cleanString($texto = '')
    {
        $texto = trim($texto);
        $aFind = ['&', 'á', 'à', 'ã', 'â', 'é', 'ê', 'í', 'ó', 'ô', 'õ', 'ú', 'ü', 'ç', 'Á', 'À', 'Ã', 'Â', 'É', 'Ê', 'Í', 'Ó', 'Ô', 'Õ', 'Ú', 'Ü', 'Ç'];
        $aSubs = ['e', 'a', 'a', 'a', 'a', 'e', 'e', 'i', 'o', 'o', 'o', 'u', 'u',
            'c', 'A', 'A', 'A', 'A', 'E', 'E', 'I', 'O', 'O', 'O', 'U', 'U', 'C', ];
        $novoTexto = str_replace($aFind, $aSubs, $texto);
        $novoTexto = preg_replace("/[^a-zA-Z0-9 @,-.;:\/]/", '', $novoTexto);

        return $novoTexto;
    }
123477
public <T> T cleanupValue(T rawValue) {
        T cleanValue;
        if (rawValue instanceof String) {
            cleanValue = (T) cleanupValue((String) rawValue);
        } else {
            cleanValue = rawValue;
        }
        return cleanValue;
    }
580082
public function input($text, $defaultValue = '', $color = null) {
        $text = $text . ($defaultValue ? ": [$defaultValue]" : ": ");
        echo $color ? $this->color($text, $color) : $text;
        return trim(trim($result = fgets(fopen('php://stdin', 'r'))) ? $result : $defaultValue);
    }
957608
public function formatDateNever($dateValue)
    {
        if ($dateValue) {
            return $this->formatDateTime($dateValue);
        } else {
            return \MUtil_Html::create()->span($this->_('never'), array('class' => 'disabled'));
        }
    }
1351415
public function trim($string, $charlist = null)
    {
        $string = (string)$string;

        if ($charlist === null) {
            return trim($string);
        } else {
            return trim($string, $charlist);
        }
    }
239239
public static function trimToNull(string $value = null, int $maxLength = null)
    {
        if ($value === null) {
            return null;
        }

        // trim it
        $value = trim($value);

        if (!$value) {
            return null;
        }

        if ($maxLength === 0 || $maxLength === null) {
            return $value;
        }

        return substr($value, 0, $maxLength);
    }