r/badcode • • Nov 26 '19

c# String Strang String Strang

Post image
776 Upvotes

54 comments sorted by

View all comments

Show parent comments

11

u/Joniator Nov 26 '19

But String would work in C#, even if it is discouraged to use it

9

u/_Stego27 Nov 26 '19

I think it needs an import though

11

u/Dalimyr codes in C#...poorly Nov 26 '19

Yup, but only because it's capitalised. It's System.String. If it had been string without a capital then it would have been perfectly fine even without System. or using System;

4

u/_Stego27 Nov 26 '19

Yeah, in this case they have used the Java String (does not need an import in java) but the c# linter is rejecting it because they have not imported System.