Skip to main content

OpenTD reference 2026 R1

Class StringExtensions

Last update: 09.03.2026

Namespace: OpenTD.Utility
Assembly: OpenTD.dll

Utility methods for working with strings.

public static class StringExtensions

Inheritance

object ← StringExtensions

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Methods

FirstToUpper(string)

Capitalizes the first letter of a string.

public static string FirstToUpper(this string str)

Parameters

str string

Returns

string

System.String.

find_first_of(string, string, int)

Finds the position of the first of a list of characters. Returns -1 on failure.

public static int find_first_of(this string input, string characters, int startPosition = 0)

Parameters

input string

characters string

The characters to search for.

startPosition int

The starting position to look in the string. Defaults to 0.

Returns

int

Connect with Ansys