public struct Osoba{
public string nazwisko;
[...]
}
for (int k = 0; k < l; k++)
{
dlugosc = osoba[k].nazwisko.Length;
[...]
if (c[0] == 's' && c[1] == 'k' && c[2] == 'i')
{
osoba[k].nazwisko[dlugosc - 3] = '*';
osoba[k].nazwisko[dlugosc - 2] = '*';
osoba[k].nazwisko[dlugosc - 1] = '*';
}
}
Hello there, I keep trying to replace 3 last letters of string, but i get this error:
Property or indexer 'string.this[int]' cannot be assigned to -- it is read only\
I tried to google it, the solution was mostly adding getters and setters (i've yet to learn about it) but it didn't help me. Why can't I modify my string even thought i set everything as public?