Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
What I try to do, is to manipulate a string with the "method" PadLeft or PadRight. None of them seems to work! An error I also not have & and I think mine code is OK!
I did try this into a simple console project: (See source code below)
Example code 1:
string str = "Align this text";
char pad = '_';
Console.WriteLine (str .PadLeft (15,pad));
Example code 2:
myString = "Align this text";
myString .PadRight (10,'i');
None of the code above is working...Did try this also into the graphical environment, with a textbox or label and it seems also not working!
Don't know if it's a "bug" or do I programme something wrong???
Thanx and best regards,
It's not a bug in Mono, it's a bug in your code. FWIW, StackOverflow would have been a more appropriate place for this.
1) Your string is already 15 characters long so padding it to a length of 15 does nothing. See http://msdn.microsoft.com/en-us/library/system.string.padleft.aspx
2) Strings in .NET/Mono are immutable, the methods on them return new strings. You are outputting the original string, not the padded one.