<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.trainzsimulator.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kessica</id>
	<title>TrainzOnline - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.trainzsimulator.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kessica"/>
	<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/wiki/Special:Contributions/Kessica"/>
	<updated>2026-11-05T11:15:31Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=VE190&amp;diff=22745</id>
		<title>VE190</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=VE190&amp;diff=22745"/>
		<updated>2020-02-09T14:55:04Z</updated>

		<summary type="html">&lt;p&gt;Kessica: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In TS2012 you can treat a Soup as a NamedTag, (vice-versa too), and it worked. But now a Soup or SubSoup is a different entity and totally different from Tag. Hence the error message Unable to be converted from Soup to text.&lt;/div&gt;</summary>
		<author><name>Kessica</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=VE190&amp;diff=22744</id>
		<title>VE190</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=VE190&amp;diff=22744"/>
		<updated>2020-02-09T14:53:11Z</updated>

		<summary type="html">&lt;p&gt;Kessica: Created page with &amp;quot;In TS2012 you can treat a Soup as a NamedTag, (vice-versa too), and it worked. But now a Soup or SubSoup is a different entity and quite apart from Tag. Hence the error messag...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In TS2012 you can treat a Soup as a NamedTag, (vice-versa too), and it worked. But now a Soup or SubSoup is a different entity and quite apart from Tag. Hence the error message Unable to be converted from Soup to text.&lt;/div&gt;</summary>
		<author><name>Kessica</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Class_Str&amp;diff=8661</id>
		<title>Class Str</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Class_Str&amp;diff=8661"/>
		<updated>2015-11-16T11:53:25Z</updated>

		<summary type="html">&lt;p&gt;Kessica: Updated the correct method to suit the example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[TrainzScript Language Reference|API Hierarchy]]&lt;br /&gt;
**Str&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Str is a static class providing string utility functions not supported by the native string object. &lt;br /&gt;
*When used in game code these methods must be prefixed &#039;&#039;Str.&#039;&#039; to reference the class.&lt;br /&gt;
*Some of these methods directly amend their parameters rather than returning values via the method.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Left==&lt;br /&gt;
{{MethodHeader|public void Left(string s, int count)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;s&#039;&#039;&#039; = string to be processed.&lt;br /&gt;
*&#039;&#039;&#039;count&#039;&#039;&#039; = count of characters to retain.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 string s = &amp;quot;Afternoon&amp;quot;;&lt;br /&gt;
 Str.Left(s,5);        // s will now be equal to &amp;quot;After&amp;quot;&lt;br /&gt;
;Notes&lt;br /&gt;
*Sets &#039;&#039;s&#039;&#039; to be a substring of itself consisting of its first &#039;&#039;count&#039;&#039; characters.&lt;br /&gt;
*Method does not return a value.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mid==&lt;br /&gt;
{{MethodHeader|public void Mid(string s, int first, int count)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;s&#039;&#039;&#039; = string to be processed.&lt;br /&gt;
*&#039;&#039;&#039;first&#039;&#039;&#039; = index of first character to retain.&lt;br /&gt;
*&#039;&#039;&#039;count&#039;&#039;&#039; = number of characters to retain.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 string s = &amp;quot;Afternoon&amp;quot;;&lt;br /&gt;
 Str.Mid(s,3,4);           // s will now be equal to &amp;quot;tern&amp;quot;&lt;br /&gt;
;Notes&lt;br /&gt;
*Sets &#039;&#039;s&#039;&#039; to be a substring of itself &#039;&#039;count&#039;&#039; characters long starting with the &#039;&#039;first&#039;&#039; character.&lt;br /&gt;
*Method does not return a value.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;I&amp;gt;To get the output specified you would need the following: Str.Mid(s,2,4); as the string array is zero based. This has been tested using TS2012 build 61388 and TANE. &amp;lt;/I&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Right==&lt;br /&gt;
{{MethodHeader|public void Right(string s, int count)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;s&#039;&#039;&#039; = string to be processed.&lt;br /&gt;
*&#039;&#039;&#039;count&#039;&#039;&#039; = number of characters to retain.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 string s = &amp;quot;Afternoon&amp;quot;;&lt;br /&gt;
 Str.Right(s,4);           // s will now be equal to &amp;quot;noon&amp;quot;&lt;br /&gt;
;Notes&lt;br /&gt;
*Sets &#039;&#039;s&#039;&#039; to be a substring of itself composed of the last &#039;&#039;count&#039;&#039; characters.&lt;br /&gt;
*Method does not return a value.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ToInt==&lt;br /&gt;
{{MethodHeader|public native int ToInt(string s)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;s&#039;&#039;&#039; = string parameter, which should be a string representation of an integer.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Integer value of string parameter.&lt;br /&gt;
;Syntax&lt;br /&gt;
 int n = Str.ToInt(&amp;quot;1234&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Converts &#039;&#039;s&#039;&#039; to an integer.&lt;br /&gt;
*Method returns 0 if the string cannot be converted.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ToFloat==&lt;br /&gt;
{{MethodHeader|public native float ToFloat(string s)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;s&#039;&#039;&#039; = string parameter, which should be a string representation of a floating point number.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Floating point value.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float length = Str.ToFloat(&amp;quot;1.5&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Converts &#039;&#039;s&#039;&#039; to a floating point number.&lt;br /&gt;
*Method returns 0.0 if the string cannot be converted.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Tokens==&lt;br /&gt;
{{MethodHeader|public native string[ ] Tokens(string s, string delimiters)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;s&#039;&#039;&#039; = string to be processed.&lt;br /&gt;
*&#039;&#039;&#039;delimiters&#039;&#039;&#039; = string of characters to use as token boundaries.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*Array of string tokens.&lt;br /&gt;
;Syntax&lt;br /&gt;
 string[] sentence = Str.Tokens(&amp;quot;Once upon a time&amp;quot;,&amp;quot;&amp;quot;);     // sentence contains an array of four strings:&lt;br /&gt;
                                                            // [&amp;quot;Once&amp;quot;,&amp;quot;upon&amp;quot;,&amp;quot;a&amp;quot;,&amp;quot;time&amp;quot;].&lt;br /&gt;
 int wordCount = Str.Tokens(&amp;quot;Once upon a time&amp;quot;,&amp;quot;&amp;quot;).size();  // returns 4&lt;br /&gt;
 string firstWord = Str.Tokens(&amp;quot;Once upon a time&amp;quot;,&amp;quot;&amp;quot;)[0];   // returns &amp;quot;Once&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 string kuidStr = &amp;quot;&amp;lt;kuid:1234:5678&amp;gt;&amp;quot;&lt;br /&gt;
 string userID = Str.Tokens(kuidStr,&amp;quot;&amp;lt;:&amp;gt;&amp;quot;)[1];              // returns &amp;quot;1234&amp;quot;&lt;br /&gt;
;Notes&lt;br /&gt;
*Splits a string into an array of tokens using any of the characters in &#039;&#039;delimiters&#039;&#039; as token boundaries.&lt;br /&gt;
*Characters contained within the &#039;&#039;delimiters&#039;&#039; string are never returned.&lt;br /&gt;
*If &#039;&#039;delimiters&#039;&#039; is null or an empty string then white space will be assumed to define the token boundaries.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ToLower==&lt;br /&gt;
{{MethodHeader|public native void ToLower(string s)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;s&#039;&#039;&#039; = string to be processed.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Str.ToLower(&amp;quot;UPPER CASE STRING&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Converts the string parameter &#039;&#039;s&#039;&#039; to lower case.&lt;br /&gt;
*Method does not return a value.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ToUpper==&lt;br /&gt;
{{MethodHeader|public native void ToUpper(string s)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;s&#039;&#039;&#039; = string to be processed.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Str.ToUpper(&amp;quot;lower case string&amp;quot;);&lt;br /&gt;
;Notes&lt;br /&gt;
*Converts the string parameter &#039;&#039;s&#039;&#039; to upper case.&lt;br /&gt;
*Method does not return a value.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TrimLeft==&lt;br /&gt;
{{MethodHeader|public native void TrimLeft(string s, string trim)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;s&#039;&#039;&#039; = string to be processed.&lt;br /&gt;
*&#039;&#039;&#039;trim&#039;&#039;&#039; = characters to remove&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Str.TrimLeft(&amp;quot;Once upon a time&amp;quot;,&amp;quot;Once &amp;quot;);      // returns &amp;quot;upon a time&amp;quot;&lt;br /&gt;
 Str.TrimLeft(&amp;quot;      result&amp;quot;,&amp;quot;&amp;quot;);               // returns &amp;quot;result&amp;quot;&lt;br /&gt;
;Notes&lt;br /&gt;
*If &#039;&#039;trim&#039;&#039; is an empty string then all white space will be stripped from the front of the string.&lt;br /&gt;
*Method does not return a value.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TrimRight==&lt;br /&gt;
{{MethodHeader|public native void TrimRight(string s, string trim)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;s&#039;&#039;&#039; = string to be processed.&lt;br /&gt;
*&#039;&#039;&#039;trim&#039;&#039;&#039; = characters to remove&lt;br /&gt;
;Returned Value&lt;br /&gt;
*None&lt;br /&gt;
;Syntax&lt;br /&gt;
 Str.TrimRight(&amp;quot;Once upon a time&amp;quot;,&amp;quot; a time&amp;quot;);      // returns &amp;quot;Once upon&amp;quot;&lt;br /&gt;
 Str.TrimRight(&amp;quot;result        &amp;quot;,&amp;quot;&amp;quot;);               // returns &amp;quot;result&lt;br /&gt;
;Notes&lt;br /&gt;
*If &#039;&#039;trim&#039;&#039; is an empty string then all white space will be stripped from the end of the string.&lt;br /&gt;
*Method does not return a value.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UnpackInt==&lt;br /&gt;
{{MethodHeader|public native int UnpackInt(string s)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;s&#039;&#039;&#039; = string to be processed.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*First integer value in &#039;&#039;s&#039;&#039;.&lt;br /&gt;
;Syntax&lt;br /&gt;
 int n = UnpackInt(&amp;quot;21st May 2008&amp;quot;);           // returns 21 and amends &#039;&#039;s&#039;&#039; to &amp;quot;st May 2008&amp;quot; &lt;br /&gt;
;Notes&lt;br /&gt;
*Strips the first integer value found from the string parameter and returns it in the method result.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UnpackFloat==&lt;br /&gt;
{{MethodHeader|public native float UnpackFloat(string s)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;s&#039;&#039;&#039; = string to be processed.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*First float value in &#039;&#039;s&#039;&#039;.&lt;br /&gt;
;Syntax&lt;br /&gt;
 float distance = UnpackFloat(&amp;quot;21.5 miles&amp;quot;);   // returns 21.5 and amends &#039;&#039;s&#039;&#039; to &amp;quot; miles&amp;quot;.&lt;br /&gt;
;Notes&lt;br /&gt;
*Strips the first floating point value found from the string parameter and returns it in the method result.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UnpackString==&lt;br /&gt;
{{MethodHeader|public native string UnpackString(string s)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;s&#039;&#039;&#039; = string to be processed.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*First string in &#039;&#039;s&#039;&#039;, excluding any leading white space.&lt;br /&gt;
;Syntax&lt;br /&gt;
 string s = &amp;quot;Once upon a time&amp;quot;;&lt;br /&gt;
 string firstWord = UnpackString(s);     // returns &amp;quot;Once&amp;quot;, s becomes &amp;quot; upon a time&amp;quot;&lt;br /&gt;
 string secondWord = UnpackString(s);    // returns &amp;quot;upon&amp;quot;, s becomes &amp;quot; a time&amp;quot;&lt;br /&gt;
 string thirdWord = UnpackString(s);     // returns &amp;quot;a&amp;quot;,    s becomes &amp;quot; time&amp;quot;&lt;br /&gt;
 string fourthWord = UnpackString(s);    // returns &amp;quot;time&amp;quot;, s becomes &amp;quot;&amp;quot;&lt;br /&gt;
;Notes&lt;br /&gt;
*Strips the first word from the string parameter (using white space for word separation) and returns it in the method result. &lt;br /&gt;
*Any leading white space is removed from the string before parsing.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==CloneString==&lt;br /&gt;
{{MethodHeader|public string CloneString(string s)}}&lt;br /&gt;
;Parameters&lt;br /&gt;
*&#039;&#039;&#039;s&#039;&#039;&#039; = The string to clone.&lt;br /&gt;
;Returned Value&lt;br /&gt;
*string - A new string in the current gamescript context which has contents that exactly match the original string.&lt;br /&gt;
;Syntax&lt;br /&gt;
 string original=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
 string copy;&lt;br /&gt;
 copy=Str.CloneString(original);&lt;br /&gt;
;Notes&lt;br /&gt;
*CloneString() creates a copy of the string passed. &lt;br /&gt;
*Ordinarily &#039;copying&#039; a string will just create a new object that references the old string. This is not allowed across different contexts.&lt;br /&gt;
*CloneString() creates a new string for use in the current context.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Related Methods==&lt;br /&gt;
&lt;br /&gt;
[[Class TrainUtil#AlreadyThereStr|TrainUtil.AlreadyThereStr()]]&lt;br /&gt;
&lt;br /&gt;
[[Class TrainUtil#CompareStrLists|TrainUtil.CompareStrLists()]]&lt;br /&gt;
&lt;br /&gt;
[[Class TrainUtil#GetUpTo|TrainUtil.GetUpTo()]]&lt;br /&gt;
&lt;br /&gt;
[[Class TrainUtil#HasPrefix|TrainUtil.HasPrefix()]]&lt;br /&gt;
&lt;br /&gt;
[[Class TrainUtil#HasSufix|TrainUtil.HasSufix()]] &#039;&#039;(sic)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Class TrainUtil#StrSubst|TrainUtil.StrSubst()]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
[[Category:Script Class]]&lt;/div&gt;</summary>
		<author><name>Kessica</name></author>
	</entry>
</feed>