# Concatenation

str1 = "Hello";
str2 = "world";

message = string(str1, " ", str2);
println(message);

message = str1 * " " * str2;
println(message);

# Interpolation

message = "$str1 $str2";
println(message);

println("2 + 8 = $(2 + 8)");

vector = [1, 2, 3];
println("Vector: $vector");

# String compare

println("abcde" < "bcde");
println("abcde" > "aacde");
println("2 + 3 == 5" == "2 + 3 == $(2 + 3)");

# Index search of character in string

str = "abcdefghi";

println(findfirst('d', str));
println(findlast('g', str));
println(findnext("gh", str, 3));
println(findprev('b', str, 4));

# Substring

println(occursin("def", str));
println(occursin('d', str));

# Repeat and join

str = "1 million = " * "1" * repeat("0", 6);
println(str);

str = join(["1", "000", "000"], ",");
println(str);

# Length of a string
println(length(str));

# Length of a substring
println(length(str, 2, 5));

# Size of a string (in bytes)
println(sizeof(str));

# reverse String

println(reverse(str));

# split string

str = "a,b,c,d,e";
println(split(str, ","));

# string replace

str = replace("Python is fast and easy", "Python" => "Julia");
println(str);

replace("Quickly Quicker", "Quick" => "Slow", 1) # Specifies max number of replacements to make