> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ninjatrader.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ninjatrader.com/_mcp/server.

# Manipulating string objects

Dealing with strings and other related concepts are essential to many computer programs. This sample is a collection of some of the most common string and text related functions including splitting a string, replacing a string with another string, and a few other string functions.

## Key concepts in this example

* Simple text/string manipulation ideas

## Important related documentation

### C\#

* [**string.IndexOf()**](https://learn.microsoft.com/en-us/dotnet/api/system.string.indexof?view=netframework-4.8)
* [**string.Replace()**](https://learn.microsoft.com/en-us/dotnet/api/system.string.replace?view=netframework-4.8)
* [**string.Split()**](https://learn.microsoft.com/en-us/dotnet/api/system.string.split?view=netframework-4.8)
* [**Escape characters**](http://msdn.microsoft.com/en-us/library/h21280bw.aspx)
* [**Foreach iterator**](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/iteration-statements)
* [**String literals**](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/strings/)

#### NinjaTrader

* [**ClearOutputWindow()**](/developer/desktop-sdk/references/common/alert-debug-share/clearoutputwindow)

A related sample demonstrating how to format numbers can be found [here](/developer/desktop-sdk/guides/educational-resources/tips/formatting-numbers).

## Import instructions

1. Download the file contained in this Help Guide topic to your PC desktop
2. From the Control Center window, select the menu Tools > Import > NinjaScript
3. Select the downloaded file

[SampleStringFunctions\_NT8.zip](https://ninjatrader.com/support/helpGuides/nt8/samples/SampleStringFunctions_NT8.zip)