You are here

function socialcalc_decode_value in Sheetnode 7.2

Same name and namespace in other branches
  1. 5 socialcalc.inc \socialcalc_decode_value()
  2. 6 socialcalc.inc \socialcalc_decode_value()
  3. 7 socialcalc.inc \socialcalc_decode_value()
3 calls to socialcalc_decode_value()
socialcalc_parse_cell in ./socialcalc.inc
socialcalc_parse_cell_value in ./socialcalc.inc
socialcalc_parse_sheet in ./socialcalc.inc

File

./socialcalc.inc, line 925
SocialCalc manipulation functions.

Code

function socialcalc_decode_value($s) {
  if (!is_string($s)) {
    return $s;
  }
  if (strstr($s, '\\') === FALSE) {

    // For performace reasons: replace nothing takes up time.
    return $s;
  }
  $r = str_replace('\\c', ':', $s);
  $r = str_replace('\\n', "\n", $r);
  return str_replace('\\b', '\\', $r);
}