-
Notifications
You must be signed in to change notification settings - Fork 47
/
GpaUtility.cs
46 lines (40 loc) · 1.26 KB
/
GpaUtility.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// =====================================================================
// <copyright file="GpaUtility.cs" company="Advanced Micro Devices, Inc.">
// Copyright (c) 2019-2020 Advanced Micro Devices, Inc. All rights reserved.
// </copyright>
// <author>
// AMD Developer Tools Team
// </author>
// <summary>
// GPA Utility class
// </summary>
// =====================================================================
using System;
using System.Windows.Forms;
using System.Collections.Generic;
using System.IO;
public static class GpaUtility
{
public static string ToCamelCase(this string singleWord)
{
if (!String.IsNullOrEmpty(singleWord))
{
return singleWord[0].ToString().ToUpper() + singleWord.Substring(1).ToLower();
}
return singleWord;
}
public static string ToCamelCase(this string wordsWithSeparator, char separator)
{
if (String.IsNullOrEmpty(wordsWithSeparator))
{
return wordsWithSeparator;
}
string[] splitStrings = wordsWithSeparator.Split(separator);
string camelCaseString = string.Empty;
foreach (string s in splitStrings)
{
camelCaseString += s.ToCamelCase();
}
return camelCaseString;
}
}