SexScripts : How do I split a string in individual chars to array? - https://ss.deviatenow.com:443/viewtopic.php?f=4&t=824 Page 1 of 1

How do I split a string in individual chars to array?

cd228 [ Sat Feb 16, 2019 7:25 pm ]

Hello

I have simply forgotten the code to split a string into individual chars.
Can someone help me?

I want a word to be split into individual characters and added in a wordArray.
After that I will need to shuffle it, which I guess I can do with the following code:


Collections.shuffle(wordArray)

Re: How do I split a string in individual chars to array?

doti [ Wed Feb 20, 2019 6:34 pm ]

Here is a complete solution, a short and simple as possible :
Code:
def chars = Arrays.asList("the string".toCharArray())
Collections.shuffle(chars)
def s = ""
for(def c : chars)
   s += c
show(s)

Page 1 of 1 All times are UTC + 1 hour [ DST ]
https://ss.deviatenow.com:443/
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Maroon Fusion theme created by Oxydo
Software, theme modifications, phpBB modification by Doti 2010, 2011