How to add spaces between the alphabets?

Hi Can someone please help me with this.
I want to add space between all the alphabets.

For exapmle

String vlaue i have:
ABCG
What i want is:
A B C G

Thanks


.

1 Like

arrhh Jacob beat me ; :wink:

4 Likes

Thanks alot both of you. Worked

1 Like

A python soluton, because i already had made this for someone else :wink:

# Define the function to add spaces between characters in a string
def kern_with_spaces(input_data):
    if isinstance(input_data, list):
        # Process each item in the list independently
        result = []
        for item in input_data:
            if isinstance(item, str):
                result.append(' '.join(item))
            else:
                result.append(str(item))
    elif isinstance(input_data, str):
        # Process a single string input
        result = ' '.join(input_data)
    else:
        result = str(input_data)

    return result

# Define the input and call the function
input_data = IN[0]  # Input from Dynamo
output_data = kern_with_spaces(input_data)

# Return the result to Dynamo
OUT = output_data
1 Like