UpTo

Method

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

Product: 

Class: 

Warning

uCalc API Preview Release Notice:The uCalc engine has successfully transitioned to modern cross-platform environments.The next phase envolves some structural changes, performance optimizations, and API refinements.The API is subject to breaking changes prior to the stable release. Please evaluate the preview version thoroughly before production use.

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

This page last modified on: 

8/21/2026