json generator alternator and vibrator (#718)
* json generator alternator and vibrator * каким хуем ты не закоммитился уебан
This commit is contained in:
25
Content.Server/_White/GuideGenerator/TextTools.cs
Normal file
25
Content.Server/_White/GuideGenerator/TextTools.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
namespace Content.Server.GuideGenerator.TextTools;
|
||||
|
||||
public sealed class TextTools
|
||||
{
|
||||
/// <summary>
|
||||
/// Capitalizes first letter of given string.
|
||||
/// </summary>
|
||||
/// <param name="str">String to capitalize</param>
|
||||
/// <returns>String with capitalized first letter</returns>
|
||||
public static string CapitalizeString(string str)
|
||||
{
|
||||
if (str.Length > 1)
|
||||
{
|
||||
return char.ToUpper(str[0]) + str.Remove(0, 1);
|
||||
}
|
||||
else if (str.Length == 1)
|
||||
{
|
||||
return char.ToUpper(str[0]).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
return str;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user