digitalmars.D.learn - string to uppercase
- stunaep (4/4) Apr 02 2016 Is there any easy way to convert a string to uppercase? I tried
- Nicholas Wilson (11/15) Apr 02 2016 asUpperCase returns a range that you can iterate over like
- Jin (7/11) Apr 02 2016 http://dpaste.dzfl.pl/b14c35f747cc
Is there any easy way to convert a string to uppercase? I tried s.asUpperCase, but it returns a ToCaserImpl, not a string, and it cant be cast to string. I also tried toUpper but it wasnt working with strings
Apr 02 2016
On Sunday, 3 April 2016 at 03:05:08 UTC, stunaep wrote:Is there any easy way to convert a string to uppercase? I tried s.asUpperCase, but it returns a ToCaserImpl, not a string, and it cant be cast to string. I also tried toUpper but it wasnt working with stringsasUpperCase returns a range that you can iterate over like auto upper = someString.asUpperCase; foreach(c; upper) { //do stuff } toUpper works with both characters (standard, w and d) as well as (w|d| )strings, please post the use case that doesn't work. There is also toUpperInPlace that will modify the string. Nic
Apr 02 2016
On Sunday, 3 April 2016 at 03:05:08 UTC, stunaep wrote:Is there any easy way to convert a string to uppercase? I tried s.asUpperCase, but it returns a ToCaserImpl, not a string, and it cant be cast to string. I also tried toUpper but it wasnt working with stringshttp://dpaste.dzfl.pl/b14c35f747cc import std.uni, std.stdio; void main() { writeln( "abcабв".toUpper ); }
Apr 02 2016