wasSharp – Blame information for rev 48

Subversion Repositories:
Rev:
Rev Author Line No. Line
7 office 1 ///////////////////////////////////////////////////////////////////////////
2 // Copyright (C) Wizardry and Steamworks 2013 - License: GNU GPLv3 //
3 // Please see: http://www.gnu.org/licenses/gpl.html for legal details, //
4 // rights of fair usage, the disclaimer and warranty conditions. //
5 ///////////////////////////////////////////////////////////////////////////
6  
7 using System.IO;
8 using System.Linq;
48 office 9 using System.Text;
7 office 10  
11 namespace wasSharp
12 {
26 office 13 public static class String
7 office 14 {
15 ///////////////////////////////////////////////////////////////////////////
16 // Copyright (C) 2015 Wizardry and Steamworks - License: GNU GPLv3 //
17 ///////////////////////////////////////////////////////////////////////////
18 /// <summary>
19 /// Combine multiple paths.
20 /// </summary>
21 /// <param name="paths">an array of paths</param>
22 /// <returns>a combined path</returns>
23 public static string PathCombine(params string[] paths)
24 {
25 return paths.Aggregate((x, y) => Path.Combine(x, y));
26 }
48 office 27  
28 /// <summary>
29 /// Converts a byte array to a hexadecimal string.
30 /// </summary>
31 /// <param name="bytes"></param>
32 /// <returns></returns>
33 public static string ToHexString(this byte[] bytes)
34 {
35 StringBuilder str = new StringBuilder();
36  
37 for (int i = 0; i < bytes.Length; i++)
38 str.AppendFormat("{0:X2}", bytes[i]);
39  
40 return str.ToString();
41 }
7 office 42 }
27 office 43 }