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
csharp beginner
NA
38
12k
loop problem.
Nov 11 2013 3:22 AM
In the following condition: after a point it takes all the values to be '0'. Can anybody tell why it is happening?
var csv = new StringBuilder();
for (int i = 0; i <= terms.Length; i++)
{
if (terms[i] == firstlistA[i])
{
string first = terms[i];
string second = firstlistB[i];
var newLine = string.Format("{0},{1}{2}", first, second, Environment.NewLine);
csv.Append(newLine);
}
else
{
string first = terms[i];
string second = "0";
var newLine = string.Format("{0},{1}{2}", first, second, Environment.NewLine);
csv.Append(newLine);
}
File.WriteAllText(sfd.FileName, csv.ToString());
Reply
Answers (
4
)
How to add background images for these code
How does CLR implement c# program?