String

Hi guys,
I couldn’t get solution for that
I’d like to get the name “BB Containment” but when I connect that node doesn’t work
I tried with string AA for example and that’s works for some reason I cannot get just one line,
its creating two elements in the list.

Remove the list level from the string0 input and set the lacing to Auto.

1 Like

Yep,
I’ve tried that before

I don’t really know what you are trying to achieve, but this Python code might be able to help you.

# Get input values
strings = IN[0]
prefix = IN[1]
remove = IN[2]

# Initialize an empty list to store the modified strings
modified_strings = []

# Check if the input is a single string or a list
if isinstance(strings, str):
    strings = [strings]
elif isinstance(strings[0], str):
    strings = [strings]

# Process each item in the input
for item in strings:
    # Check if the item is a list
    if isinstance(item, list):
        # Initialize an empty list to store the modified strings within each inner list
        modified_inner_strings = []
        
        # Process each string in the inner list
        for string in item:
            # Add prefix and remove specified characters
            modified_string = prefix + " " + string.replace(remove, "").strip()
            
            # Append modified string to the list within each inner list
            modified_inner_strings.append(modified_string)
        
        # Append the modified list within each inner list to the main modified strings list
        modified_strings.append(modified_inner_strings)
    else:
        # Add prefix and remove specified characters
        modified_string = prefix + " " + item.replace(remove, "").strip()
        
        # Append modified string to the main modified strings list
        modified_strings.append(modified_string)

# Output the modified strings as "Result"
OUT = modified_strings
1 Like

Hi @Henrique.Nandi think string insert could help you here…

1 Like

Hello

cordially
christian.stan