-1

in python you could write

string = "abcdef"
character = string[1]
print(character)

and your output would be

b

What would the c# equivalent be?

12Bits
  • 89
  • 4

1 Answers1

2

It is the same way in other languages as well,

string s = "abcdef";
char c = s[1];
Console.WriteLine(c);

Fiddle Example

Sajeetharan
  • 203,447
  • 57
  • 330
  • 376