Entitas  0.40.0
Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
ComponentStringExtension.cs
1 namespace Entitas {
2 
3  public static class ComponentStringExtension {
4 
5  const string COMPONENT_SUFFIX = "Component";
6 
7  public static string AddComponentSuffix(this string componentName) {
8  return componentName.EndsWith(COMPONENT_SUFFIX, System.StringComparison.Ordinal)
9  ? componentName
10  : componentName + COMPONENT_SUFFIX;
11  }
12 
13  public static string RemoveComponentSuffix(this string componentName) {
14  return componentName.EndsWith(COMPONENT_SUFFIX, System.StringComparison.Ordinal)
15  ? componentName.Substring(0, componentName.Length - COMPONENT_SUFFIX.Length)
16  : componentName;
17  }
18  }
19 }