You are here

public static function PHPExcel_Calculation_TextData::TRIMSPACES in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/TextData.php \PHPExcel_Calculation_TextData::TRIMSPACES()

* TRIMSPACES * *

Parameters

mixed $stringValue Value to check: * @return string

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/TextData.php, line 119

Class

PHPExcel_Calculation_TextData
PHPExcel_Calculation_TextData

Code

public static function TRIMSPACES($stringValue = '') {
  $stringValue = PHPExcel_Calculation_Functions::flattenSingleValue($stringValue);
  if (is_bool($stringValue)) {
    return $stringValue ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
  }
  if (is_string($stringValue) || is_numeric($stringValue)) {
    return trim(preg_replace('/ +/', ' ', trim($stringValue, ' ')), ' ');
  }
  return NULL;
}