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
Guest User
Tech Writer
357
120.9k
Syntax meaning
Jul 25 2012 5:34 PM
Hi,
Given the following code example.
public string AddSomethingMethod(string templateName)
return GetString(new object[] { templateName });
From what I know, object[] is an array of objects.
However the reference being passed in is of type string (singular) and not an array of strings.
The GetString method accepts a parameter of params object[] args.
And the logic does the following:-
for(int i = 0; i < args.Length; i++)
string str1 = args[i] as string;
if(str1 != null) || str1.Length > 0x400
args[i] = str1.Substring(0, 0x3fd) + "...";
return args;
From this I gather that the string being passed in, is broken down into chars hence why the object array is used?
Regards
Steven
Reply
Answers (
12
)
LINQ HELP
Can't move controls on Windows form