Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S::split should work with empty delimiter, resulting in splitting string to array of chars #7

Open
meszaros-lajos-gyorgy opened this issue Apr 15, 2021 · 1 comment
Labels
enhancement New feature or request need more info Further information is requested, or there are still questions on how to solve the issue

Comments

@meszaros-lajos-gyorgy
Copy link
Owner

explode() does not permit having an empty delimiter

@meszaros-lajos-gyorgy
Copy link
Owner Author

<?php
function splitToChars($str){
	$chars = [];
	for ($i = 0; $i < strlen($str); $i++) {
		$chars[] = $str[$i];
	}
	return $chars;
}

This is not multibyte string safe, but a good base point

@meszaros-lajos-gyorgy meszaros-lajos-gyorgy added enhancement New feature or request need more info Further information is requested, or there are still questions on how to solve the issue labels Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request need more info Further information is requested, or there are still questions on how to solve the issue
Projects
None yet
Development

No branches or pull requests

1 participant