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
Matthew Smith
NA
2
2.1k
newbie - getting weird returned value
Dec 1 2015 11:12 PM
I am new to c#, so bear with me. I have written a recursive function, but I am getting an odd return value. This is the value I am getting back:
System.Collections.Generic.List`1[System.Int32]
When it should be something like this:
10-14-53-60
Here is the function. I would appreciate any help.
static string CallBack(string TheInputList, int ThePosition)
{
try
{
var TheList = TheInputList.Split('-').Select(int.Parse).ToList();
int IncrementedPositionValue = TheList.ElementAt(ThePosition) + 1;
TheList[ThePosition] = IncrementedPositionValue;
if (IncrementedPositionValue == 96)
{
for (int i = 1; i <= ThePosition; i++)
{
TheList[i] = 1;
}
int NextPosition = ThePosition + 1;
string TheNewList = CallBack(TheList.ToString(), NextPosition);
return TheNewList;
}
else
{
string TheReturnString = TheList.ToString();
return TheReturnString;
}
}
catch {
TheInputList = TheInputList + "-0";
string TheList = null;
TheList = CallBack(TheInputList, ThePosition);
return TheList;
}
Reply
Answers (
2
)
interface and abstract class
bind grid view using stored procedure with two queries.