TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sudheer Kumar
NA
105
9.8k
string assigning error
Dec 20 2017 8:28 AM
with the below code i am getting an error as
Property or indexer 'string.this[int]' cannot be assigned to -- it is read only
can some one explain why?
public class Program
{
static void Main(string[] args)
{
string userName = "Joey";
GreetUser(userName);
Console.WriteLine(userName);
}
public static void GreetUser(string userName)
{
userName[0] = 'm'; //line1
char c = userName[0]; //line2
userName = "Hello" + userName; //line3
}
}
Reply
Answers (
1
)
Invoke or BeginInvoke cannot be called on a control
program payment monthly using c++