mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-26 15:58:35 +00:00
4f6d1f77a3
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.
124 lines
2.4 KiB
PHP
124 lines
2.4 KiB
PHP
<?php
|
|
|
|
use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
|
|
|
|
return [
|
|
[
|
|
[['Hello', 'World']],
|
|
[
|
|
'Hello World',
|
|
' ',
|
|
'',
|
|
],
|
|
],
|
|
[
|
|
[['Hello'], ['World']],
|
|
[
|
|
'Hello World',
|
|
'',
|
|
' ',
|
|
],
|
|
],
|
|
[
|
|
[['To', 'be', 'or', 'not', 'to', 'be']],
|
|
[
|
|
'To be or not to be',
|
|
' ',
|
|
'',
|
|
],
|
|
],
|
|
[
|
|
[
|
|
['1', '2', '3'],
|
|
['4', '5', '6'],
|
|
],
|
|
[
|
|
'1,2,3;4,5,6',
|
|
',',
|
|
';',
|
|
],
|
|
],
|
|
[
|
|
[
|
|
['Do', ' Or do not', ' There is no try', ' ', 'Anonymous'],
|
|
],
|
|
[
|
|
'Do. Or do not. There is no try. -Anonymous',
|
|
['.', '-'],
|
|
'',
|
|
],
|
|
],
|
|
[
|
|
[['Do'], [' Or do not'], [' There is no try'], [' '], ['Anonymous']],
|
|
[
|
|
'Do. Or do not. There is no try. -Anonymous',
|
|
'',
|
|
['.', '-'],
|
|
],
|
|
],
|
|
[
|
|
[
|
|
['Do', ' Or do not', ' There is no try', ' '],
|
|
['Anonymous', ExcelError::NA(), ExcelError::NA(), ExcelError::NA()],
|
|
],
|
|
[
|
|
'Do. Or do not. There is no try. -Anonymous',
|
|
'.',
|
|
'-',
|
|
],
|
|
],
|
|
[
|
|
[
|
|
['', '', '1'],
|
|
['', '', ExcelError::NA()],
|
|
['', '2', ''],
|
|
['3', ExcelError::NA(), ExcelError::NA()],
|
|
['', ExcelError::NA(), ExcelError::NA()],
|
|
['', '4', ExcelError::NA()],
|
|
],
|
|
[
|
|
'--1|-|-2-|3||-4',
|
|
'-',
|
|
'|',
|
|
],
|
|
],
|
|
[
|
|
[
|
|
['1'],
|
|
['2'],
|
|
['3'],
|
|
['4'],
|
|
],
|
|
[
|
|
'--1|-|-2-|3||-4',
|
|
'-',
|
|
'|',
|
|
true,
|
|
],
|
|
],
|
|
[
|
|
[['', 'BCD', 'FGH', 'JKLMN', 'PQRST', 'VWXYZ']],
|
|
[
|
|
'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
|
|
['A', 'E', 'I', 'O', 'U'],
|
|
'',
|
|
],
|
|
],
|
|
'slash as column delimiter' => [
|
|
[['Hello', 'World']],
|
|
[
|
|
'Hello/World',
|
|
'/',
|
|
'',
|
|
],
|
|
],
|
|
'slash as row delimiter' => [
|
|
[['ho', 'w'], ['about', '#N/A'], ['t', 'hat']],
|
|
[
|
|
'ho.w/about/t.hat',
|
|
'.',
|
|
'/',
|
|
],
|
|
],
|
|
];
|