r/shittyprogramming • u/ToastDroid • Nov 20 '18
How to Capitalize a String
word.ToCharArray()[0] = word.ToCharArray()[0].ToString().ToUpper().ToCharArray()[0];
69
Upvotes
r/shittyprogramming • u/ToastDroid • Nov 20 '18
word.ToCharArray()[0] = word.ToCharArray()[0].ToString().ToUpper().ToCharArray()[0];
57
u/[deleted] Nov 20 '18
what the fuck
17
u/techworker123 Nov 21 '18 edited Nov 21 '18
Short PHP snippet, no idea what your problem actually is, just do
composer require corelib/uppercase30
u/ILikeLenexa Nov 20 '18
10
u/Prawny Nov 20 '18
Just ask EA.
1
u/calsosta Nov 21 '18
Where the fuck is the XOR?
-1
u/TheTrueSwishyFishy Nov 20 '18
In what language would this work? You can’t set something that’s not a variable (word.toCharArray()[0]) to a value. In JavaScript the error would be something along the lines of ReferenceError: invalid assignment left-hand side