Jump to content

papyrus split text by comma


Swe-DivX

Recommended Posts

Posted

Im trying to split test0, i cant find any example of this.

 

string test0 = ""
if btest1
   test0 += ",test1"
endif
if btest2
   test0 += ",test2"
endif
if btest3
   test0 += ",test3"
endif

 

Test[0] = test0
Test[1] = test0
Test[2] = test0

 

Posted

You want to split text0 into parts divided by commas?

Something like:

Text0 = "A, B, C"

Text[0] = "A"

Text[1] = "B"

Text[2] = "C" ?

Posted
32 minutes ago, AndrewLRG said:

You want to split text0 into parts divided by commas?

Something like:

Text0 = "A, B, C"

Text[0] = "A"

Text[1] = "B"

Text[2] = "C" ?


Yes, it for dynamic menu

Posted

It can be done with PapyrusUtil.

 

---------------------

String Text = "AAA, BBB, CCC"

 

String[] TextArray = PapyrusUtil.StringSplit(Text, ",")

-------------------------

 

TextArray[0] will be AAA

TextArray[1] - BBB

TextArray[2] - CCC

Posted
4 minutes ago, AndrewLRG said:

It can be done with PapyrusUtil.

 

---------------------

String Text = "AAA, BBB, CCC"

 

String[] TextArray = PapyrusUtil.StringSplit(Text, ",")

-------------------------

 

TextArray[0] will be AAA

TextArray[1] - BBB

TextArray[2] - CCC


I will try it tomorrow

Posted
On 4/19/2021 at 5:36 PM, AndrewLRG said:

It can be done with PapyrusUtil.

 

---------------------

String Text = "AAA, BBB, CCC"

 

String[] TextArray = PapyrusUtil.StringSplit(Text, ",")

-------------------------

 

TextArray[0] will be AAA

TextArray[1] - BBB

TextArray[2] - CCC


It works, i can now add new menus and remove them if the external mod is disable

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...