axiosengine/axios/Engine/Extensions/String.cs
Nathan Adams 6016693851 + * - Adding an extension to determine what side the objects collided on
+ * - Correcting misspelling of Extensions in String and Texture2D
2012-05-16 22:04:03 -05:00

20 lines
663 B
C#

namespace Axios.Engine.Extensions
{
public static class AxiosExtensions_String
{
/// <summary>
/// Get the string slice between the two indexes.
/// Inclusive for start index, exclusive for end index.
/// </summary>
public static string Slice(this string source, int start, int end)
{
if (end < 0) // Keep this for negative end support
{
end = source.Length + end;
}
int len = end - start; // Calculate length
return source.Substring(start, len); // Return Substring of length
}
}
}