Hi I have a few syntax problems as I build a date from a string that looks like
My code :
paramCheckDate = "01/14/2022"
CheckDateYYYYMMDD = paramCheckDate.split["/"][2].toString() + paramCheckDate.split["/"][1].toString() + paramCheckDate.split["/"][0].toString()
I would like to build another string in the format YYYYMMDD. Splitting by index and then .toString but I have syntax errors if I can get some guidance that would be awesome!
split("/")String.splitis a function, so you should call it with parentheses not brackets.paramCheckDate.split(...)paramCheckDate.split("/").reverse().join("");I like to use this instead. It is clean.