NabeelScript Functions

Built-in Functions

Print Function

print("Hello, World!");

String Functions

length("Hello");  // Returns 5
uppercase("hello");  // Returns "HELLO"
lowercase("WORLD");  // Returns "world"
trim("  Hello  ");  // Returns "Hello"
replace("Hello, World!", "World", "NabeelScript");  // Returns "Hello, NabeelScript!"

Array Functions

arr = [1, 2, 3, 4, 5];
push(arr, 6);  // Returns [1, 2, 3, 4, 5, 6]
pop(arr);  // Returns 5, arr becomes [1, 2, 3, 4]
length(arr);  // Returns 4
first(arr);  // Returns 1
last(arr);  // Returns 4

Join and Split Functions

join("-", ["apple", "banana", "cherry"]);  // Returns "apple-banana-cherry"
split("apple,banana,cherry", ",");  // Returns ["apple", "banana", "cherry"]

Count Function

count("Hello, World!", "l");  // Returns 3
count(["apple", "banana", "apple"], "apple");  // Returns 2

File Operations

content = read_file("input.txt");
write_file("output.txt", "Hello, NabeelScript!");