Added 'Thermal' readouts category including:
[VesselSimulator.git] / KerbalEngineer / Extensions / StringExtensions.cs
blob:a/KerbalEngineer/Extensions/StringExtensions.cs -> blob:b/KerbalEngineer/Extensions/StringExtensions.cs
--- a/KerbalEngineer/Extensions/StringExtensions.cs
+++ b/KerbalEngineer/Extensions/StringExtensions.cs
@@ -1,1 +1,33 @@
+// 
+//     Kerbal Engineer Redux
+// 
+//     Copyright (C) 2015 CYBUTEK
+// 
+//     This program is free software: you can redistribute it and/or modify
+//     it under the terms of the GNU General Public License as published by
+//     the Free Software Foundation, either version 3 of the License, or
+//     (at your option) any later version.
+// 
+//     This program is distributed in the hope that it will be useful,
+//     but WITHOUT ANY WARRANTY; without even the implied warranty of
+//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//     GNU General Public License for more details.
+// 
+//     You should have received a copy of the GNU General Public License
+//     along with this program.  If not, see <http://www.gnu.org/licenses/>.
+// 
 
+namespace KerbalEngineer.Extensions
+{
+    public static class StringExtensions
+    {
+        public static string ToLength(this string value, int length)
+        {
+            if (value != null && value.Length > length)
+            {
+                value = value.Substring(0, length) + "...";
+            }
+            return value;
+        }
+    }
+}