﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » .NET Forums » General .NET Discussion  » String Comparison</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Mon, 08 Jun 2026 23:04:36 GMT</lastBuildDate><ttl>20</ttl><item><title>String Comparison</title><link>http://forum.strataframe.net/FindPost7271.aspx</link><description>Hello all,&lt;/P&gt;&lt;P&gt;The language we are converting from had a handle function we could call that would do string comparisons.&amp;nbsp; For example:&lt;/P&gt;&lt;P&gt;If InString("DEF", "ABCDEFXYZ", 1, 1)&lt;BR&gt;&amp;nbsp;&amp;nbsp; ...Do something - return value was 3 (found at character position 3)&lt;BR&gt;Else&lt;BR&gt;&amp;nbsp;&amp;nbsp; ...Comparison failed&lt;BR&gt;End &lt;/P&gt;&lt;P&gt;Params for INSTRING(SubString, String, (optional Step), (optional Start))&lt;BR&gt;SubString - A string constant, variable or expression that contains the string for which to search&lt;/P&gt;&lt;P&gt;String - A string constant or variable to be searched&lt;/P&gt;&lt;P&gt;Step - An optional numeric constant, variable or expression which specifies the step length of the search.&amp;nbsp; A step of 1 would search for the substring at every character in string, 2 starts at every other character. A negative step value of -1 will search from right to left within the string.&amp;nbsp; If omitted, step is defaulted to the length of the substring&lt;/P&gt;&lt;P&gt;Start - An optional numeric constant, variable or expression which specifies where to begin the search of the string.&amp;nbsp; If omitted it is defaulted to 1.&lt;/P&gt;&lt;P&gt;I have looked at the String Comparison method of the String type and it does not seem to fit the bill.&amp;nbsp; Before coding this function myself, does anyone know of any other built-in methods that would work just like the Clarion InString function? Or offer a code snippet?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Ben</description><pubDate>Fri, 02 Mar 2007 12:38:30 GMT</pubDate><dc:creator>Ben Kim</dc:creator></item><item><title>RE: String Comparison</title><link>http://forum.strataframe.net/FindPost7277.aspx</link><description>Thanks Greg.&amp;nbsp; This should work out find with the exception of reverse searching which I do not believe we used anyway in the legacy code.&lt;/P&gt;&lt;P&gt;Ben</description><pubDate>Fri, 02 Mar 2007 12:38:30 GMT</pubDate><dc:creator>Ben Kim</dc:creator></item><item><title>RE: String Comparison</title><link>http://forum.strataframe.net/FindPost7273.aspx</link><description>Ben, &lt;br&gt;
&lt;br&gt;
Check out String.IndexOf.   I.e. "abcdef".IndexOf("def") = 3&lt;br&gt;
&lt;br&gt;</description><pubDate>Fri, 02 Mar 2007 11:23:18 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item></channel></rss>