Click here to Skip to main content
15,888,177 members
Home / Discussions / C#
   

C#

 
GeneralDataGrid Column Alignment Pin
albean22-Jul-03 7:26
albean22-Jul-03 7:26 
GeneralRe: DataGrid Column Alignment Pin
A.Wegierski23-Jul-03 3:35
A.Wegierski23-Jul-03 3:35 
GeneralPosition of Characters in a String Pin
.gonad22-Jul-03 6:51
.gonad22-Jul-03 6:51 
GeneralRe: Position of Characters in a String Pin
Julian Bucknall [MSFT]22-Jul-03 7:08
Julian Bucknall [MSFT]22-Jul-03 7:08 
GeneralRe: Position of Characters in a String Pin
David Stone22-Jul-03 7:16
sitebuilderDavid Stone22-Jul-03 7:16 
GeneralRe: Position of Characters in a String Pin
.gonad22-Jul-03 9:04
.gonad22-Jul-03 9:04 
GeneralRe: Position of Characters in a String Pin
Julian Bucknall [MSFT]22-Jul-03 11:37
Julian Bucknall [MSFT]22-Jul-03 11:37 
GeneralRe: Position of Characters in a String Pin
Frank Olorin Rizzi22-Jul-03 7:14
Frank Olorin Rizzi22-Jul-03 7:14 
My cheap $0.02:

Option #1:
the same code you have up there, but put the value of i (when s[i] is equal to " ") in a collection (Hashtable, ArrayList, what have you).

Option #2:
use IndexOf(" ") and cut the starting part of the string every time...

string s1 = "Its a beautiful day to be coding";
string s2 = s1; //To save the original s1 if needed
Hashtable ht = new Hashtable(); //Use whatever you need instead of an hashtable
while(s2.Length>0)
{
int k = s2.IndexOf(" ");
if(k<0)
{
break; //No more spaces found
}//IF
ht.Add(ht.Count, k); //Save in ht the index where the next space is found
s2 = s2.Substr(k+1); //Cut away everything up to the space
}//WEND
//Disclaimer: I have not compiled nor tested this code

Maybe it could be better to use a StringBuilder Smile | :)

HTH,
Olorin
GeneralRe: Position of Characters in a String Pin
Bo Hunter22-Jul-03 15:58
Bo Hunter22-Jul-03 15:58 
GeneralWindows.Forms, Linux and C# Pin
User 665822-Jul-03 5:47
User 665822-Jul-03 5:47 
GeneralRe: Windows.Forms, Linux and C# Pin
Rein Hillmann22-Jul-03 6:19
Rein Hillmann22-Jul-03 6:19 
GeneralRe: Windows.Forms, Linux and C# Pin
Alex Korchemniy22-Jul-03 7:17
Alex Korchemniy22-Jul-03 7:17 
GeneralRe: Windows.Forms, Linux and C# Pin
Daniel Turini22-Jul-03 7:17
Daniel Turini22-Jul-03 7:17 
GeneralRe: Windows.Forms, Linux and C# Pin
User 665823-Jul-03 1:16
User 665823-Jul-03 1:16 
QuestionIs there a clean way to remove a control and it's associated event handlers? Pin
work_to_live22-Jul-03 5:36
work_to_live22-Jul-03 5:36 
AnswerRe: Is there a clean way to remove a control and it's associated event handlers? Pin
Frank Olorin Rizzi22-Jul-03 7:17
Frank Olorin Rizzi22-Jul-03 7:17 
GeneralRe: Is there a clean way to remove a control and it's associated event handlers? Pin
work_to_live22-Jul-03 9:27
work_to_live22-Jul-03 9:27 
AnswerRe: Is there a clean way to remove a control and it's associated event handlers? Pin
James T. Johnson22-Jul-03 8:13
James T. Johnson22-Jul-03 8:13 
GeneralRe: Is there a clean way to remove a control and it's associated event handlers? Pin
work_to_live22-Jul-03 9:29
work_to_live22-Jul-03 9:29 
AnswerRe: Is there a clean way to remove a control and it's associated event handlers? Pin
Ista22-Jul-03 9:22
Ista22-Jul-03 9:22 
Generalpassing this as read/write Pin
Ista22-Jul-03 5:29
Ista22-Jul-03 5:29 
GeneralDont look at me funny for asking this Pin
RB@Emphasys22-Jul-03 4:32
RB@Emphasys22-Jul-03 4:32 
GeneralRe: Dont look at me funny for asking this Pin
Ista22-Jul-03 9:23
Ista22-Jul-03 9:23 
Generalremoting.config question Pin
LongRange.Shooter22-Jul-03 4:11
LongRange.Shooter22-Jul-03 4:11 
Generalprobs with print: Generic/Text only :confused: Pin
troels_sorensen22-Jul-03 4:09
troels_sorensen22-Jul-03 4:09 

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.