( string_convert )
Legend
| → | Has corresponding code |
| → | No direct match, but an alternative exists |
| → | No corresponding code |
| - | TODO |
| ( .. ) | Not localized |
| Example | Python pytest |
PHP PHPUnit |
Swift Testing |
Csharp xunit |
Bash bats |
Powershell pester |
C++ GoogleTest |
JavaScript Jest |
Kotlin jUnit |
|---|---|---|---|---|---|---|---|---|---|
| ( trim_whitespace ) | strip | trim | - | - | - | - | - | - | - |
| ( trim_leading_whitespace ) | lstrip | ltrim | - | - | - | - | - | - | - |
| ( trim_trailing_whitespace ) | rstrip | rtrim | - | - | - | - | - | - | - |
| ( trim_trailing_newline_characters ) | rstrip('\r\n') | rtrim($s, "\r\n") | - | - | - | - | - | - | - |
| ( trim_indent ) | textwrap.dedent | → | - | - | - | - | - | - | trimIndent |
| ( encode_uri_for_query ) | urllib.parse.quote_plus | urlencode | - | - | - | - | - | - | URLEncoder.encode |
| ( encode_uri_for_path ) | urllib.parse.quote | rawurlencode | - | - | - | - | - | - | → |
| ( encode_uri_slash_escaped_or_not ) | No | Yes | - | - | - | - | - | - | - |
| ( decode_uri_for_query ) | urllib.parse.unquote_plus | urldecode | - | - | - | - | - | - | URLDecoder.decode |
| ( decode_uri_for_path ) | urllib.parse.unquote | rawurldecode | - | - | - | - | - | - | → |
| ( escape_html ) | html.escape | htmlspecialchars | - | - | - | - | - | - | → |
| ( unescape_html ) | html.unescape | htmlspecialchars_decode | - | - | - | - | - | - | → |
| ( string_to_hex ) | encode + hex | bin2hex | - | - | - | - | - | - | → |
| ( hex_to_string ) | fromhex + decode | hex2bin | - | - | - | - | - | - | → |
| ( convert_charset ) | encode | mb_convert_encoding | - | - | - | - | - | - | toByteArray |
| ( normalize_nfc ) | unicodedata.normalize | Normalizer::normalize | - | - | - | - | - | - | Normalizer.normalize |
| ( charcode_to_char ) | chr | mb_chr | - | - | - | - | - | - | i.toChar |
| ( char_to_charcode ) | ord | mb_ord | - | - | - | - | - | - | c.code |
| ( expand_tabs ) | s.expandtabs | → | - | - | - | - | - | - | → |
| ( tabify ) | → | → | - | - | - | - | - | - | → |
| ( capitalize ) | capitalize | ucfirst + strtolower | - | - | - | - | - | - | → |
| ( titlize ) | titlize | ucwords + strtolower | - | - | - | - | - | - | → |
| ( to_upper ) | upper | strtoupper | - | - | "#{s^^}" | - | - | - | uppercase |
| ( to_lower ) | lower | strtolower | - | - | "${s,,}" | - | - | - | lowercase |
| ( reverse ) | s[::-1] | strrev() | - | - | - | - | - | - | reverse |
| ( zen_to_han_alnum_only ) | unicodedata.normalize('NFKC', s) | mb_convert_kana($s, 'as', 'UTF-8') | - | - | - | - | - | - | Normalizer.Form.NFKC |
| ( han_to_zen_alnum_only ) | → | mb_convert_kana($s, 'AS', 'UTF-8') | - | - | - | - | - | - | → |
| ( trim ) | - | - | - | - | ${text##+([[:space:]])} | - | - | - | trim |
| ( trim_first ) | - | - | - | - | ${text##+([[:space:]])} | - | - | - | trimStart |
| ( trim_last ) | - | - | - | - | ${text%%+([[:space:]])} | - | - | - | trimLast |