File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -15,11 +15,33 @@ private static readonly Regex RouteParameterRegex
15
15
public static string ToCamelCaseFromPascalCase ( string inPascalCase )
16
16
{
17
17
if ( ! string . IsNullOrEmpty ( inPascalCase ) )
18
- return $ "{ inPascalCase . First ( ) . ToString ( ) . ToLower ( ) } { inPascalCase . Substring ( 1 ) } ";
18
+ return $ "{ char . ToLower ( inPascalCase . First ( ) ) } { inPascalCase . Substring ( 1 ) } ";
19
19
else
20
20
return inPascalCase ;
21
21
}
22
22
23
+ public static string ToPascalCaseFromCamelCase ( string inCamelCase )
24
+ {
25
+ if ( ! string . IsNullOrEmpty ( inCamelCase ) )
26
+ return $ "{ char . ToUpper ( inCamelCase . First ( ) ) } { inCamelCase . Substring ( 1 ) } ";
27
+ else
28
+ return inCamelCase ;
29
+ }
30
+
31
+ public static string ToPascalCaseFromKebabCase ( string inKebabCase )
32
+ {
33
+ if ( ! string . IsNullOrEmpty ( inKebabCase ) )
34
+ {
35
+ var parts = inKebabCase
36
+ . Split ( new [ ] { '-' } , StringSplitOptions . RemoveEmptyEntries )
37
+ . Select ( v => $ "{ char . ToUpper ( v . First ( ) ) } { v . Substring ( 1 ) } ") ;
38
+
39
+ return string . Join ( string . Empty , parts ) ;
40
+ }
41
+ else
42
+ return inKebabCase ;
43
+ }
44
+
23
45
public static string GetBaseEndpoint ( List < WebApiRoutePart > routeParts )
24
46
{
25
47
var baseEndpointParts = routeParts
You can’t perform that action at this time.
0 commit comments