Skip to content

Instantly share code, notes, and snippets.

View DeveloperOfficeCom's full-sized avatar

DeveveloperOffice.com DeveloperOfficeCom

View GitHub Profile
@DeveloperOfficeCom
DeveloperOfficeCom / enumerate.cfm
Last active July 18, 2025 05:35
Return array of index-value pairs from input array
<!---
ENUMERATE Function
Description: Returns an array of [index, value] pairs from an input array
Parameters:
- array: The array to enumerate (required)
- start: Starting index value (optional, default: 0)
- asStruct: Return as array of structs instead of arrays (optional, default: false)
@DeveloperOfficeCom
DeveloperOfficeCom / startswith.cfm
Last active July 18, 2025 05:40
Check if string starts with prefix
<!---
STARTSWITH Function
Description: Checks if a string starts with a specified prefix
Parameters:
- string: The string to check (required)
- prefix: The prefix to look for (required)
- caseSensitive: Whether to perform case-sensitive comparison (optional, default: true)
@DeveloperOfficeCom
DeveloperOfficeCom / endswith.cfm
Last active July 18, 2025 05:41
Check if string ends with suffix
<!---
ENDSWITH Function
Description: Checks if a string ends with a specified suffix
Parameters:
- string: The string to check (required)
- suffix: The suffix to look for (required)
- caseSensitive: Whether to perform case-sensitive comparison (optional, default: true)
@DeveloperOfficeCom
DeveloperOfficeCom / center.cfm
Last active July 18, 2025 05:44
Center string within field of specified width with custom fill character
<!---
CENTER Function
Description: Centers a string within a field of specified width
Parameters:
- string: The string to center (required)
- width: The total width of the result (required)
- fillChar: Character to use for padding (optional, default: " ")
@DeveloperOfficeCom
DeveloperOfficeCom / zfill.cfm
Last active July 18, 2025 13:52
Zero-pad strings and numbers to specified width
<!---
ZFILL Function
Description: Pads a string with leading zeros to reach specified width. Handles negative numbers by placing zeros after the minus sign.
Parameters:
- inputString: The string to pad with zeros (required)
- width: The target width of the result string (required)
Returns: String padded with leading zeros to reach the specified width
@DeveloperOfficeCom
DeveloperOfficeCom / count.cfm
Last active July 18, 2025 14:09
Count occurrences of substring with case sensitivity and overlap options
<!---
COUNT Function
Description: Counts non-overlapping occurrences of substring in string. Set overlap=true to count overlapping occurrences.
Parameters:
- inputString: The string to search in (required)
- substring: The substring to count (required)
- overlap: Whether to count overlapping occurrences (optional, default: false)
@DeveloperOfficeCom
DeveloperOfficeCom / join.cfm
Last active July 18, 2025 14:29
Join array elements into string with separator and advanced options
<!---
JOIN Function
Description: Joins array elements into a string using a separator. Similar to Python's str.join() method.
Parameters:
- separator: The separator to join elements with (required)
- array: The array of elements to join (required)
Returns: String with array elements joined by the separator
@DeveloperOfficeCom
DeveloperOfficeCom / strip.cfm
Last active July 18, 2025 14:30
Remove specified characters from both ends of string
<!---
STRIP Function
Description: Removes specified characters from both ends of a string. If no characters specified, removes whitespace.
Parameters:
- inputString: The string to strip characters from (required)
- chars: Characters to remove from both ends (optional, default: whitespace)
Returns: String with specified characters removed from both ends
@DeveloperOfficeCom
DeveloperOfficeCom / lstrip.cfm
Last active July 18, 2025 14:31
Remove specified characters from the left side of string
<!---
LSTRIP Function
Description: Removes specified characters from the left (beginning) of a string. If no characters specified, removes whitespace.
Parameters:
- inputString: The string to strip characters from (required)
- chars: Characters to remove from the left end (optional, default: whitespace)
Returns: String with specified characters removed from the left end
@DeveloperOfficeCom
DeveloperOfficeCom / rstrip.cfm
Last active July 18, 2025 14:31
Remove specified characters from the right side of string
<!---
RSTRIP Function
Description: Removes specified characters from the right (end) of a string. If no characters specified, removes whitespace.
Parameters:
- inputString: The string to strip characters from (required)
- chars: Characters to remove from the right end (optional, default: whitespace)
Returns: String with specified characters removed from the right end