Feature Request: Split Function

Started by @-Cloud'''Star… on

Topic category: Feature requests and ideas for MCreator

Last seen on 19:49, 9. Feb 2024
Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Feature Request: Split Function
Sun, 12/03/2023 - 12:56 (edited)

Would it be possible to add a function that splits a string into several other strings using a certain pattern as a seperator? For example, the string "I love MCreator" split with the pattern "e" would result in an array like this: {"I lov", " MCr", "ator"}. If you don't want to add arrays, you could add fuctions like this instead: "Select index [int] of string [string] split by pattern [string]" and "Get number of splits from string [string] split by pattern [string]". With the string "One Split Two Split Three" and the pattern " Split " would output {"Two" if the index was [2] on "Select index [int] of string [string] split by pattern [string]" was used} and {[3] if "Get number of splits from string [string] split by pattern [string]" was used}

 

Arrays would also be nice if it were to get official support because then a split function that outputs an array would be supported.

Edited by @-Cloud'''Star'''Sky-@ on Sun, 12/03/2023 - 12:56