uCalc API Version: 2.1.3-preview.2 Released: 6/16/2026

Warning

uCalc API Preview Release Notice:The documentation describes the intended behavior of the API. The current preview build contains incomplete features, unoptimized performance, and is subject to breaking changes.

UpTo

Method

Product: 

String Library

Class: 

String

Returns a substring with all text up to and including the matched pattern

Syntax

UpTo(string, int)

Parameters

Pattern
string
Pattern to match
Nth
int
(Default = 1)
nth occurence

Return

String

uCalc String object

Remarks

Returns all text up to and including the matched pattern. By default it goes up to the first occurence of a match, but you may elect to have it go up to the nth occurence.

Examples