1 //
2 // Copyright (c) 2010-2018 Antmicro
3 //
4 // This file is licensed under the MIT License.
5 // Full license text is available in 'licenses/MIT.txt'.
6 //
7 using System.Linq;
8 using System.Text;
9 
10 namespace Antmicro.Renode.RobotFramework
11 {
12     public static class HelperExtensions
13     {
StripNonSafeCharacters(this string input)14         public static string StripNonSafeCharacters(this string input)
15         {
16             return Encoding.UTF8.GetString(Encoding.UTF8.GetBytes(input).Where(x => (x >= 32 && x <= 126) || (x == '\n')).ToArray());
17         }
18     }
19 }
20