Ich sehe diese Frage bereits eine Antwort akzeptiert hat, aber ich dachte, dass ich eine andere Antwort hinzufügen würde :)
Sie es, indem ich tun können, wo das Wort ‚Großes‘ ist in der Zeichenkette. Mit modernen CFML können Sie es wie folgt:
<cfscript>
myVar = "One of the myths associated with the Great Wall of China is that it is the only man-made structure";
// where is the word 'Great'?
a = myVar.FindNoCase("Great");
substring = myVar.removeChars(1, a-1);
writeDump(substring);
</cfscript>
Mit Mitte würde Ihnen ein bisschen mehr Flexibilität, wenn Sie aus den beiden Enden schneiden Zeichen wollen.
<cfscript>
myVar = "One of the myths associated with the Great Wall of China is that it is the only man-made structure";
// where is the word 'Great'?
a = myVar.FindNoCase("Great");
// get the substring
substring = myVar.mid(a, myVar.len());
writeDump(substring);
</cfscript>
In älteren Versionen von CF, die als geschrieben werden würde:
<cfscript>
myVar = "One of the myths associated with the Great Wall of China is that it is the only man-made structure";
// where is the word 'Great'
a = FindNoCase("Great", myVar);
// get the substring
substring = mid(myVar, a, len(myVar));
writeDump(substring);
</cfscript>
Sie auch einen regulären Ausdruck verwenden, könnte das gleiche Ergebnis zu erzielen, werden Sie entscheiden, welche in geeigneter ist Ihre Anwendungsfall:
<cfscript>
myVar = "One of the myths associated with the Great Wall of China is that it is the only man-made structure";
// strip all chars before 'Great'
substring = myVar.reReplaceNoCase(".+(Great)", "\1");
writeDump(substring);
</cfscript>