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
John
NA
928
131k
Recursive function in foreach
Jun 1 2017 12:41 AM
I have to call a function recursively using foreach something like this
public JsonResult GetPath(string node)
{
try
{
var project_id = "abc";
String fName = "";
String fID = "";
foreach (
s
tring items in GetFolders(project_id, node
))
{
for (int j = 0; j < items.Length; j++)
{
if (items.Length == 100000)
{
break;
}
else
{
var Totalitems = items.Split('~');
folderID = Totalitems[0].ToString();
FolderName += Totalitems[1].ToString()+",";
}
}
GetPath(items);
}
}
catch(Exception)
{
}
return Json("", JsonRequestBehavior.AllowGet);
}
In this method this
GetFolders
will return and array
Problem is i cant declare string array in foreach
Reply
Answers (
3
)
How to Write this VB6.0 Function in VB.net
Please convert and give me the below code to c#