Osy#the first language built for agents
Agents firstAgentic appsWorkflowsDurable Execution — built inSecurityTestingThe editorThe UI modelOne program

Reference / Function

Text.Concat

Text.Concat(values) → string (the elements run together, with nothing between them)

Joins a list of values into one string with NOTHING between the elements. It is Text.Join with no separator, and the same operation as string.Concat. A single non-list value is converted on its own. Runs in memory.

stable1 example compiled by CIfunctiontextstdlibcollection

Summary#

Text.Concat(values) runs the elements of values together into one string, with nothing between them. It is Text.Join with an empty separator, and identical to string.Concat(values).

Reach for it when the pieces already carry whatever punctuation they need — path segments that end in /, pre-formatted fragments, an accumulated list of chunks. When you want something between the elements, use Text.Join.

Signature#

Text.Concat(<list> values)  -> string
string.Concat(<list> values) -> string   // the same operation

Each element is converted to its string form first, exactly as string interpolation would convert it.

Description#

It is Text.Join with no separator#

The two are the same operation and differ only in what falls between the elements — nothing, versus the separator you name. Text.Concat(parts) and Text.Join("", parts) produce identical output; prefer Concat, which says the intent without an empty-string argument to read past.

An empty list yields the empty string#

There is nothing to run together, so the result is "" — not null. That means a Concat over a filtered list stays safe when the filter matched nothing, with no length check first.

A single value is converted on its own#

Passed one non-list value, it converts that value and returns it. That makes it usable as a plain "to string" in code that sometimes holds a list and sometimes holds one item, without branching.

It runs in memory, on whichever side the cursor is already on#

Like the rest of Text.*, it is a pure in-memory operation — no round trip, and no hand-off. A component may call it while rendering; a server function may call it mid-body. See execution side.

Examples#

entity Doc {
  [Required, MaxLength(200)] string Title;
  security { allow read when IsAuthenticated || IsAnonymous; allow create, update when IsAuthenticated || IsAnonymous; }
}

// The segments already carry their own separators, so anything BETWEEN them would be wrong.
string BuildPath(string[] segments) {
  return Text.Concat(segments);
}

// An empty list is the empty string — no length check needed before calling.
string Nothing() {
  return Text.Concat([]);
}

See also#

Related

Text.Join

Joins a list of values into one string, placing the separator between each pair. It is the inverse of Text.Split, and…

String interpolation & format specifiers

Build a string from literal text and embedded expressions with $"…{expr}…". A hole may carry a .NET format specifier…

Text.Split

The C# string.Split: breaks a string on a separator and returns the substrings as a List<string> — iterable with…