You’re not providing enough inputs to Element.ToString or String.Split. A red input on a node means that you need to provide a value.
You should just be able to use String from Object instead of Element.ToString and a blank string ("") as the separator for String.Split. That will give you each of the string characters at an index that you can then replace via a dictionary and rejoin.
I have made some good progress from yesterday, I have attached an screenshot of my updated script. Thanks for your help so far.
I had to add a String from Object again after String.Length for items to appear in the watch list.
I have managed to use the String.Split node which has split the lists into individual lists.
I now want to break each entry down into its individual characters so I can target the fifth character and replace it with the letter I need. I have had a look online and can’t seem to work this out.
Thanks for your response! I was planning to split my building numbers into individual characters before moving on. Are you suggesting that this step might not be necessary?
Also, is the screenshot you shared an example of a dictionary, or does it specifically address changing the fifth character like I need to?
I now want to input all my building number into this instead of the Code Block I have used as an example. I have given this a quick go and my index is looking at the fourth building number not the fourth character of each building number.
List levels are definitely the next step. Using a dictionary to update the value of the 5th character (4th index) makes that step trivial and then you just replace the old value with the new one and re-join.
I’m not sure this is the issue as the script outputs exactly what I want before I inpute my building number list.
Using the the test Code Block the building number is split into it’s 5 characters and I am able to specify the fourth index and replace it with the relevant letter.
You need to use List Levels to specify that you want the 4th index of each sublist. Right now you’re just getting the 4th sublist which is the 4th building number. The difference is the list structure you’re providing, not the code block or its values.