title: Comparison of substring operation performance between .NET and Java
body: <p>Taking substrings of a string is a very common string manipulation operation, but I heard that there might be considerable differences in performance/implementation between the Java and .NET platform. Specifically I heard that in Java, <code>java.lang.String</code> offers <em>constant</em> time operation for <code>substring</code>, but in .NET, <code>System.String</code> offers <em>linear</em> performance <code>Substring</code>.</p>
  
  <p>Are these really the case? Can this be confirmed in the documentation/source code, etc? Is this implementation specific, or specified by the language and/or platform? What are the pros and cons of each approach? What should a person migrating from one platform to another look for to avoid falling into any performance pitfalls?</p>