Concatenating


String Concatenation (+)

Use the plus operator

str1 = "some" 
str2 = "text"
result = str1 + str2

print(result[3]) ' positive indices from the left / start
print(result[-3]) ' negative indices from the right / end

str3 = '' ' empty string


string.format

custom string formatting

textstring = 'Hello, ' + first_name + ' ' + last_name 
textstring = 'Hello, {} {}'.format(first_name, last_name)
textstring = 'Hello, {0} {1}'.format(first_name, last_name)
textstring = f'Hello, {first_name} {last_name}'

The 'f' stands for format and the variable names are used inline.



© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext