mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-22 08:09:15 +00:00
Accommodating Slash with preg_quote - Text Functions (#3582)
PR #3513, developed by @SaidkhojaIftikhor, has been stuck for some time awaiting tests. This is the first of three PRs to replace that one. This accomodates the use of slash as a delimiter in functions TEXTAFTER, TEXTBEFORE, TEXTSPLIT, and NUMBERVALUE. The source changes are very simple. Additional tests exercise all the source changes.
This commit is contained in:
@@ -51,6 +51,8 @@ return [
|
||||
],
|
||||
'no arguments' => ['exception'],
|
||||
'boolean argument' => ['#VALUE!', true],
|
||||
'slash as group separator' => [1234567.1, '1/234/567.1', '.', '/'],
|
||||
'slash as decimal separator' => [1234567.1, '1,234,567/1', '/', ','],
|
||||
'issue 3574 null string treated as 0' => [0, '', ',', ' '],
|
||||
'issue 3574 one or more spaces treated as 0' => [0, ' ', ',', ' '],
|
||||
'issue 3574 non-blank numeric string okay' => [2, ' 2 ', ',', ' '],
|
||||
|
||||
@@ -248,4 +248,11 @@ return [
|
||||
1,
|
||||
],
|
||||
],
|
||||
'slash delimiter' => [
|
||||
'about/that',
|
||||
[
|
||||
'How/about/that',
|
||||
'/',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
@@ -240,4 +240,11 @@ return [
|
||||
1,
|
||||
],
|
||||
],
|
||||
'slash delimiter' => [
|
||||
'How',
|
||||
[
|
||||
'How/about/that',
|
||||
'/',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
@@ -104,4 +104,20 @@ return [
|
||||
'',
|
||||
],
|
||||
],
|
||||
'slash as column delimiter' => [
|
||||
[['Hello', 'World']],
|
||||
[
|
||||
'Hello/World',
|
||||
'/',
|
||||
'',
|
||||
],
|
||||
],
|
||||
'slash as row delimiter' => [
|
||||
[['ho', 'w'], ['about', '#N/A'], ['t', 'hat']],
|
||||
[
|
||||
'ho.w/about/t.hat',
|
||||
'.',
|
||||
'/',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user