Skip to content

Latest commit

 

History

History
53 lines (40 loc) · 900 Bytes

File metadata and controls

53 lines (40 loc) · 900 Bytes

Strings in TechScript

Strings in TechScript are UTF-8 encoded, dynamic sequences of characters.


📝 Literals

String literals are enclosed in double quotes:

greeting = "Hello, World!"

⚡ String Interpolation

To insert variables or expressions directly into strings, prepend a $ character to create an interpolated string:

name = "Boss"
age = 30
message = $"Hello {name}, you are {age} years old."
say message

Expressions inside the curly brackets {} are fully evaluated at runtime:

say $"1 + 1 is {1 + 1}"

🧬 String Operations

Concatenation

Use the + operator to join strings:

full_name = "Tech" + "Script"

Length

Retrieve character count:

say len("TechScript") # 10

Containment

Check if a substring exists inside a string:

when "Script" in "TechScript"
    say "Matches!"
end