▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Моды/String Utilities
String Utilities

String Utilities

A mod that provides more NBT string operations.

Оцените первым
939
0

String Utilities Mod

A mod that provides more NBT string operations.
一个提供更多 NBT 字符串操作的模组。

Syntax 语法

/string <method> [target] [source...]

The target and source parts are similar to what follows the data modify command.
targetsource部分与data modify命令后面的部分类似。

Example 例子

  • /string isEmpty value "" returns 1
  • /string indexOf value "asdfghjkl" value "qwerty" returns -1
  • /string escape storage a:b c value '\'quote"slash\\' stores 'quote\"slash\\ into a:b/c
  • /string strip storage foo:bar baz value " a 123 " stores a 123 into foo:bar/baz
  • /string concat2 storage a b from entity @s SelectedItem.id from entity @s Inventory[0].id
  • /string join storage test playerUUID from value "~" from @s UUID

Available Methods 可用的方法

NameSourceTargetReturn Value
isBlankString-1 if the input is a blank string, 0 otherwise.
isEmptyString-1 if the input is a empty string, 0 otherwise.
lengthString-String length.
toStringAny NBT ElementStringString length.
toJsonAny NBT ElementStringString length.
escapeStringStringString length.
escapeNbtStringStringString length.
escapeRegexStringStringString length.
toLowerCaseStringStringString length.
toUpperCaseStringStringString length.
toLowerCaseInvariantStringStringString length.
toUpperCaseInvariantStringStringString length.
stripStringStringString length.
stripLeadingStringStringString length.
stripTrailingStringStringString length.
toCharArrayStringList<String>Count of code points.
toCodePointStringsStringList<String>Count of code points.
toCodePointsStringIntArrayCount of code points.
fromCodePointsIntArrayStringString length.
breakCharactersStringList<String>Count of results.
breakCharactersInvariantStringList<String>Count of results.
breakLinesStringList<String>Count of results.
breakLinesInvariantStringList<String>Count of results.
breakSentencesStringList<String>Count of results.
breakSentencesInvariantStringList<String>Count of results.
breakWordsStringList<String>Count of results.
breakWordsInvariantStringList<String>Count of results.
concatList<String>StringString length.
concat2String s0, String s1, [String s2]StringString length.
trimString src, [String trimChars]StringString length.
trimStartString src, [String trimChars]StringString length.
trimEndString src, [String trimChars]StringString length.
atString src, Int indexStringUnicode code point.
codePointAtString src, Int indexStringUnicode code point.
codePointBeforeString src, Int indexStringUnicode code point.
repeatString src, Int countStringString length.
matchesAllString src, String patternList<Compound(Int start, Int end)>Count of match results.
matchesAllFullyString src, String patternList<Compound(Int start, Int end)>Count of match results.
joinString delimiter, List elementsStringString length.
substringString src, Int begin, [Int end]StringString length.
substring2String src, Int begin, [Int length]StringString length.
splitString src, String separator, [Int limit]List<String>Count of splitted string parts
indexOfString src, String substring, [Int fromIndex]StringThe index of the first occurrence of the substring, or -1 if the substring is not contained.
lastIndexOfString src, String substring, [Int fromIndex]StringThe index of the last occurrence of the substring, or -1 if the substring is not contained.
startsWithString src, String prefix, [Int offset]-1 if the second input is a prefix of the first input, 0 otherwise.
endsWithString src, String suffix-1 if the second input is a suffix of the first input, 0 otherwise.
containsString src, String substring-1 if the first input contains the second input, 0 otherwise.
matchesString src, String regex-1 if the first input matches the second input, 0 otherwise.
replaceString src, String target, String replacementStringString length.
replaceAllString src, String regex, String replacementStringString length.
replaceFirstString src, String regex, String replacementStringString length.

Note: Some methods actually accept any NBT element, but convert it to a string before processing.
注:有些方法实际上接受任何 NBT 元素,但在处理之前将其转换为字符串。

Часто задаваемые вопросы

Совместимость

Minecraft: Java Edition

1.21.x1.20.x1.19.x1.18.x1.17.x1.16.x1.15.x1.14.x

Платформы

Поддерживаемые окружения

Сервер

Зависимости

Ссылки

Создатели

Детали

Лицензия:
Опубликован:1 год назад
Обновлён:5 месяцев назад
Главная