mirror of
https://github.com/suk-ws/ph-Bookshelf.git
synced 2024-12-05 01:16:53 +08:00
补充上一个 commit 缺失的 StringUtils 工具类
This commit is contained in:
parent
8f43bdc2c1
commit
a9b9a94275
16
src/Utils/StringUtils.php
Normal file
16
src/Utils/StringUtils.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
class StringUtils {
|
||||
|
||||
/**
|
||||
* 删除所给字符串的换行符
|
||||
*
|
||||
* @param string $str 所给字符串
|
||||
*
|
||||
* @return string 剔除换行符的版本
|
||||
*/
|
||||
public static function rmEOL(string $str): string {
|
||||
return str_replace(array("\r\n", "\r", "\n"), "", $str);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user