# TruncateString

## Description

Returns a string with all characters removed after a given character. The original string is unmodified and a new string is returned with the characters removed. This searches backwards from the end of the string to the beginning and at the first occurance of the character removes it and everything after it. Note that if you are calling this command from tier 2 then the returned string must be deleted when you are done with it.

## Definition

string TruncateString( str, character )

char* agk::TruncateString( const char* str, const char* character )

## Parameters

- str - The string to modify
- character - The character to look for, must be a single character