Complete Zoho Creator String Functions Guide - LEN, SUBSTRING, REPLACE & More

Complete Zoho Creator String Functions Guide

Creator Scripts

Zoho Trusted Partner in Digital Transformation

Complete Zoho Creator String Functions Guide

Essential String Functions

1. len() - String Length

text_variable = "Hello World";
string_length = len(text_variable);
// Returns: 11

2. substring() - Extract Portions

full_text = "Zoho Creator";
// Extract from position 5 to 11
result = substring(full_text, 5, 11);
// Returns: "Creator"

// Extract from position 0 to 4
result2 = substring(full_text, 0, 4);
// Returns: "Zoho"

3. indexOf() - Find Position

text = "Zoho Creator is powerful";
position = indexOf(text, "Creator");
// Returns: 5

// Case-sensitive search
position2 = indexOf(text, "creator");
// Returns: -1 (not found)

4. replace() - Text Replacement

original = "Hello World";
new_text = replace(original, "World", "Creator");
// Returns: "Hello Creator"

// Replace all occurrences
text = "test test test";
result = replace(text, "test", "demo");
// Returns: "demo demo demo"

5. trim() - Remove Whitespace

messy_text = " Hello World ";
clean_text = trim(messy_text);
// Returns: "Hello World"

// Also removes tabs and newlines
complex_text = "\t\n Zoho \n\t";
cleaned = trim(complex_text);
// Returns: "Zoho"

6. concat() - Join Strings

first_name = "John";
last_name = "Smith";
full_name = concat(first_name, " ", last_name);
// Returns: "John Smith"

// Alternative using + operator
full_name2 = first_name + " " + last_name;
// Returns: "John Smith"

7. split() - Break Into List

csv_data = "apple,banana,orange";
fruit_list = split(csv_data, ",");
// Returns: ["apple", "banana", "orange"]

// Access individual elements
first_fruit = fruit_list.get(0);
// Returns: "apple"

Advanced String Functions

8. toUpperCase() & toLowerCase()

text = "Zoho Creator";
upper_text = toUpperCase(text);
// Returns: "ZOHO CREATOR"

lower_text = toLowerCase(text);
// Returns: "zoho creator"

9. contains() - Check Existence

email = "user@zoho.com";
is_zoho = contains(email, "zoho");
// Returns: true

// Case-sensitive
is_ZOHO = contains(email, "ZOHO");
// Returns: false

10. startsWith() & endsWith()

filename = "report.pdf";
is_pdf = endsWith(filename, ".pdf");
// Returns: true

url = "https://zoho.com";
is_secure = startsWith(url, "https");
// Returns: true

Performance Optimization Tips

✅ Best Practices

  • Cache string operations: Store results in variables for reuse
  • Use indexOf() before substring(): Verify position exists first
  • Minimize nested string functions: Break complex operations into steps
  • Validate input: Check for null/empty strings before processing
  • Use contains() for simple checks: More efficient than indexOf() != -1

Real-World Examples

Email Validation Function

email_input = input.Email;
if(len(email_input) > 0 && contains(email_input, "@")) {
  at_position = indexOf(email_input, "@");
  domain = substring(email_input, at_position + 1, len(email_input));
  if(contains(domain, ".")) {
    // Valid email format
    info "Valid email: " + email_input;
  }
}

Name Formatting Function

full_name = trim(input.Full_Name);
if(len(full_name) > 0) {
  name_parts = split(full_name, " ");
  first_name = name_parts.get(0);
  if(name_parts.size() > 1) {
    last_name = name_parts.get(name_parts.size() - 1);
  }
  // Capitalize first letters
  formatted_first = toUpperCase(substring(first_name, 0, 1)) + toLowerCase(substring(first_name, 1, len(first_name)));
}

Common Pitfalls to Avoid

⚠️ Watch Out For

  • Index out of bounds: Always check string length before substring()
  • Null values: Validate variables before string operations
  • Case sensitivity: Use toLowerCase() for consistent comparisons
  • Empty strings: Check len() > 0 before processing
  • Special characters: Be aware of encoding issues with international text

Next Steps with Zoho Creator

Ready to implement these string functions in your Creator applications? When you're ready to build powerful text processing workflows, you can get started with Zoho Creator's advanced development platform, where you'll have access to the complete Deluge scripting environment.

Creator Scripts Advanced Support

Need custom string processing solutions or advanced Deluge development?

  • Custom function libraries and reusable code modules
  • Performance optimization for large text processing
  • Integration with external text processing APIs
  • Advanced validation and formatting workflows

Connect With Creator Scripts

⭐ Proud Winner of Zoho Creator's Tech Star in Healthcare ⭐

Trusted by Businesses Worldwide

This email was sent automatically with Creator Scripts

© 2025 Creator Scripts - Zoho Trusted Partner in Digital Transformation