in unicon/icon it would be<p>procedure StringSplit(str)<p><pre><code> #
# define a local to hold an initial empty list
#
local l := list()
#
# if the length of the string is odd then concatenate an "_" character
#
str ||:= ((*str % 2 = 1) & "_")
#
# scan the string and put each two characters onto the end of the list
# created above, fail when you reach the end of the string
#
str ? while put(l, move(2))
#
# return the list to the calling program
#
return l
end
</code></pre>
and for an example string of "this is a string" it will return the list
["th", "is", " i", "s ", "a ", "st", "ri", "ng"]<p>and for an example string of "this is a string2" it will return the list
["th", "is", " i", "s ", "a ", "st", "ri", "ng", "2_"]<p>Nice and simple compared to the example given in Java.