Click here to Skip to main content
15,923,087 members
Home / Discussions / C#
   

C#

 
AnswerRe: Help to solve: index was out of range must be nonnegative and less than the size of the collection in c# Pin
OriginalGriff12-Jun-14 1:12
mveOriginalGriff12-Jun-14 1:12 
GeneralRe: Help to solve: index was out of range must be nonnegative and less than the size of the collection in c# Pin
EADever12-Jun-14 1:38
EADever12-Jun-14 1:38 
GeneralRe: Help to solve: index was out of range must be nonnegative and less than the size of the collection in c# Pin
OriginalGriff12-Jun-14 1:44
mveOriginalGriff12-Jun-14 1:44 
GeneralRe: Help to solve: index was out of range must be nonnegative and less than the size of the collection in c# Pin
EADever12-Jun-14 1:43
EADever12-Jun-14 1:43 
GeneralRe: Help to solve: index was out of range must be nonnegative and less than the size of the collection in c# Pin
OriginalGriff12-Jun-14 1:44
mveOriginalGriff12-Jun-14 1:44 
QuestionPropertyGrid - List rows in a file in a GridITem Pin
Mc_Topaz12-Jun-14 0:07
Mc_Topaz12-Jun-14 0:07 
AnswerRe: PropertyGrid - List rows in a file in a GridITem Pin
Eddy Vluggen12-Jun-14 0:35
professionalEddy Vluggen12-Jun-14 0:35 
QuestionRe: PropertyGrid - List rows in a file in a GridITem Pin
Mc_Topaz12-Jun-14 1:05
Mc_Topaz12-Jun-14 1:05 
GeneralRe: PropertyGrid - List rows in a file in a GridITem Pin
Eddy Vluggen12-Jun-14 3:00
professionalEddy Vluggen12-Jun-14 3:00 
GeneralRe: PropertyGrid - List rows in a file in a GridITem Pin
Mc_Topaz12-Jun-14 3:49
Mc_Topaz12-Jun-14 3:49 
GeneralRe: PropertyGrid - List rows in a file in a GridITem Pin
Mc_Topaz12-Jun-14 3:58
Mc_Topaz12-Jun-14 3:58 
Answer[Solved] Re: PropertyGrid - List rows in a file in a GridITem Pin
Mc_Topaz12-Jun-14 4:17
Mc_Topaz12-Jun-14 4:17 
GeneralRe: [Solved] Re: PropertyGrid - List rows in a file in a GridITem Pin
Eddy Vluggen12-Jun-14 5:24
professionalEddy Vluggen12-Jun-14 5:24 
Question(Nishant)plz solve this issue Pin
Nishant.Chauhan8011-Jun-14 21:58
Nishant.Chauhan8011-Jun-14 21:58 
AnswerRe: (Nishant)plz solve this issue Pin
Pete O'Hanlon11-Jun-14 22:19
mvePete O'Hanlon11-Jun-14 22:19 
GeneralRe: (Nishant)plz solve this issue Pin
Nishant.Chauhan8011-Jun-14 23:00
Nishant.Chauhan8011-Jun-14 23:00 
AnswerRe: (Nishant)plz solve this issue Pin
OriginalGriff11-Jun-14 22:39
mveOriginalGriff11-Jun-14 22:39 
GeneralRe: (Nishant)plz solve this issue Pin
Nishant.Chauhan8011-Jun-14 23:02
Nishant.Chauhan8011-Jun-14 23:02 
GeneralRe: (Nishant)plz solve this issue Pin
Pete O'Hanlon11-Jun-14 23:12
mvePete O'Hanlon11-Jun-14 23:12 
GeneralRe: (Nishant)plz solve this issue Pin
Nishant.Chauhan8011-Jun-14 23:21
Nishant.Chauhan8011-Jun-14 23:21 
GeneralRe: (Nishant)plz solve this issue Pin
OriginalGriff11-Jun-14 23:48
mveOriginalGriff11-Jun-14 23:48 
GeneralRe: (Nishant)plz solve this issue Pin
Nishant.Chauhan8011-Jun-14 23:54
Nishant.Chauhan8011-Jun-14 23:54 
GeneralRe:plz solve this issue Pin
Nishant.Chauhan8011-Jun-14 23:57
Nishant.Chauhan8011-Jun-14 23:57 
QuestionGetExternalLoginInfoAsync return null on server in google-plus auth in mvc5 Pin
aree21411-Jun-14 19:44
aree21411-Jun-14 19:44 
QuestionLoad .srt file into datagrid Pin
ZinusMero11-Jun-14 15:43
ZinusMero11-Jun-14 15:43 
Hi,

This has been driving me mad all week, so finally I gave in an am posting for some help. I am a budding c# programmer and have made lots of simple programs. Every time I decide to try something new, something crops up that I can't yet solve.

I am trying to make an editor for syncing srt subtitle files. I can load the subtitle file, I can send it to a textbox if i want to, i can trim and split the time line and send them to different places, but I am having difficulty processing it as a whole.

I practiced splitting and trimming the time line when i had the text string in a textbox just to make it simple. The srt file is structured like:

1
00:00:01,151 --> 00:00:03,432
Subtitle Line 1

2
00:00:05,651 --> 00:00:07,238
Subtitle Line 1 sub 2
Subtitle Line 2 sub 2

3
00:00:08,751 --> 00:00:10,065
Subtitle Line 1 sub 3
etc etc etc

I placed the "00:00:01,151 --> 00:00:03,432" line in textBox1 and using the code:

C#
//splits the string and keeps the text before the -->
string startTime = textBox1.Text;
string result = startTime.Substring(0, theString.IndexOf("-->")).Trim();
textBox4.Text = result;

//takes the text after the delimiter
int index = textBox1.Text.IndexOf('>');
string result2 = textBox1.Text.Substring(index + 2); 
textBox5.Text = result2;


This code puts each part into separate text boxes and works as i want.

I have a good handle on logic code and can understand what i need to do, but not how to do it.

-I need to read the line and if it contains only an integer, send it to column 1.
-I need to read the line and if it contains '-->' use the above code and send it to cols 2 and 3.
-I need to read the next line and send it to col 4 (1st subtitle text line, will always contain text)
-I need to read the line and if it is blank, make a new row, else append the text to the text in column 4 and then make new row. Then start over.

Logically, i know what to do, but i am having trouble with looping through and processing each line.

Does anyone have any tips that could help me? Thanks
> Load "Stumped",8,1

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.