This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +1
-25
lines changed
Expand file tree Collapse file tree 3 files changed +1
-25
lines changed Original file line number Diff line number Diff line change @@ -69,11 +69,6 @@ public override string ReadAllText(string filePath)
6969 return File . ReadAllText ( filePath ) ;
7070 }
7171
72- public override string ToTitleCase ( string value )
73- {
74- return TextInfo . ToTitleCase ( value ) . Replace ( "_" , String . Empty ) ;
75- }
76-
7772 public override string ToInvariantUpper ( char value )
7873 {
7974 return value . ToString ( CultureInfo . InvariantCulture ) . ToUpper ( ) ;
Original file line number Diff line number Diff line change @@ -79,8 +79,6 @@ public static void Configure(PclExport instance)
7979
8080 public string PlatformName = "Unknown" ;
8181
82- public TextInfo TextInfo = CultureInfo . InvariantCulture . TextInfo ;
83-
8482 public RegexOptions RegexOptions = RegexOptions . None ;
8583
8684 public StringComparison InvariantComparison = StringComparison . Ordinal ;
@@ -93,23 +91,6 @@ public static void Configure(PclExport instance)
9391
9492 public abstract string ReadAllText ( string filePath ) ;
9593
96- public virtual string ToTitleCase ( string value )
97- {
98- string [ ] words = value . Split ( '_' ) ;
99-
100- for ( int i = 0 ; i <= words . Length - 1 ; i ++ )
101- {
102- if ( ( ! object . ReferenceEquals ( words [ i ] , string . Empty ) ) )
103- {
104- string firstLetter = words [ i ] . Substring ( 0 , 1 ) ;
105- string rest = words [ i ] . Substring ( 1 ) ;
106- string result = firstLetter . ToUpper ( ) + rest . ToLower ( ) ;
107- words [ i ] = result ;
108- }
109- }
110- return string . Join ( "" , words ) ;
111- }
112-
11394 // HACK: The only way to detect anonymous types right now.
11495 public virtual bool IsAnonymousType ( Type type )
11596 {
Original file line number Diff line number Diff line change @@ -748,7 +748,7 @@ public static string ToPascalCase(this string value)
748748
749749 public static string ToTitleCase ( this string value )
750750 {
751- return PclExport . Instance . ToTitleCase ( value ) ;
751+ return CultureInfo . InvariantCulture . TextInfo . ToTitleCase ( value ) . Replace ( "_" , String . Empty ) ;
752752 }
753753
754754 public static string ToLowercaseUnderscore ( this string value )
You can’t perform that action at this time.
0 commit comments