Skip to content

feat(evaluator): Add REPT, EXACT, PROPER, CLEAN, CHAR, CODE, T, N #117

@arcaputo3

Description

@arcaputo3

Summary

Add secondary text functions for advanced text processing.

Functions to Implement

Function Description Excel Signature
REPT(text, n) Repeat text n times REPT(text, number_times)
EXACT(text1, text2) Case-sensitive compare EXACT(text1, text2)
PROPER(text) Title Case PROPER(text)
CLEAN(text) Remove non-printable chars CLEAN(text)
CHAR(n) Character from code CHAR(number)
CODE(text) Code from first character CODE(text)
T(value) Convert to text if not already T(value)
N(value) Convert to number if not already N(value)

Implementation Notes

REPT

  • REPT("*", 5)"*****"
  • n must be >= 0

EXACT

  • Returns TRUE/FALSE
  • Case-sensitive: EXACT("Hello", "hello") → FALSE

PROPER

  • PROPER("hello WORLD")"Hello World"
  • Handles apostrophes: "o'brien""O'Brien"

CLEAN

  • Removes characters 0-31 (control characters)
  • Preserves char 32+ (printable)

CHAR/CODE

  • Uses ASCII/Unicode
  • CHAR(65)"A", CODE("A") → 65

T

  • Returns text if input is text, empty string otherwise
  • T("hello")"hello", T(123)""

N

  • Returns number if input is number, 0 otherwise
  • N(123) → 123, N("hello") → 0, N(TRUE) → 1

Test Cases

REPT("*", 5) == "*****"
EXACT("Hello", "hello") == false
PROPER("hello WORLD") == "Hello World"
CLEAN("hello" + char(7) + "world") == "helloworld"
CHAR(65) == "A"
CODE("ABC") == 65
T("hello") == "hello"
T(123) == ""
N(123) == 123
N("hello") == 0

Priority

Low - Secondary text functions

Milestone

v0.6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions