MCPcopy Create free account
hub / github.com/KiCad/kicad-source-mirror / InitialCaps

Function InitialCaps

common/string_utils.cpp:418–436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

416
417
418wxString InitialCaps( const wxString& aString )
419{
420 wxArrayString words;
421 wxString result;
422
423 wxStringSplit( aString, words, ' ' );
424
425 result.reserve( aString.length() );
426
427 for( const wxString& word : words )
428 {
429 if( result.IsEmpty() )
430 result += word.Capitalize();
431 else
432 result += wxT( " " ) + word.Lower();
433 }
434
435 return result;
436}
437
438
439int ReadDelimitedText( wxString* aDest, const char* aSource )

Callers 1

Calls 3

wxStringSplitFunction · 0.85
lengthMethod · 0.45
IsEmptyMethod · 0.45

Tested by

no test coverage detected