/// *************************************************************************** /// This file and its related files are protected by copyright and intellectual /// property disclaimers. Use of it by you or your organisation must be covered /// by prior agreement, and may involve NDA and other restriction. Duplication, /// distribution or disclosure of any part of this file are likely prohibited, /// and violations of the licensing terms will be pursued by law. /// *************************************************************************** /// Further details of the stock LothianProductionsCommon usage agreement are /// available at: http://www.lothianproductions.co.uk/lpc/#license /// *************************************************************************** using System; using System.Text; using LothianProductions.Util.Cache; namespace LothianProductions.Util { /// /// This is a PARTIAL class for HVoIPM distribution. /// public class StringHelper { public static String ExtractSubstring( String search, String startFrom, String runTo, String startAfter ) { return ExtractSubstring( search, startFrom, runTo, search.IndexOf( startAfter ) ); } public static String ExtractSubstring( String search, String startFrom, String runTo, int startAfter ) { int startAt = search.IndexOf( startFrom, startAfter ); return search.Substring( // Start immediately after start tag. startAt + startFrom.Length, // Look for end tag right after end of start tag. search.IndexOf( runTo, startAt + startFrom.Length ) - ( startAt + startFrom.Length ) ); } } }