I have
def dict = [some_key : ['a', 'bc', 'd']]
I would like to split bcby band c, so after splitting the dict will look like this:
bc
b
c
dict = [some_key : ['a', 'b', 'c', 'd']]
Is there a way to do this using the built-in methods?
Here you go:
def dict = [some_key : ['a', 'bc', 'd']] dict.some_key = dict.some_key.collect { it.collect{ it } }.sum() println dict
collectcalled in Stringwill return a character List.
collect
String
List
Source: https://habr.com/ru/post/1589205/More articles:Meteor JS installs on Ubuntu 14.04.x ββ- node.jscomparison of scalars in dplyr filter - rAndroid - Tamagotchi, game in the background - androidhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1589203/does-recyclerview-have-any-benefits-other-than-forcing-developers-to-use-the-viewholder-pattern&usg=ALkJrhggByg-gCQ_vmRAxvcmrEey4PwfmAHow to hide [1] in print () in R - htmlQTableWidgetItem background color change - pythonThe input format for the Kruskal-Wallis test in Python - pythonIs it possible to redirect the user to launch the scanner application? - javascriptto create vectors for the pirate H-test Kruskal-Wallis - pythonThreading Issues - multithreadingAll Articles