| | |
what is the easiest way to get words in a string?
Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jan 2008
Posts: 2,052
Reputation:
Solved Threads: 118
i am creating a small cpu simulator and i need to parse the assembly instruction which is like "add $s1 $s2 $s3", i need to get these four individual words ignoring the white spaces, if i use string.split(' '), it wont work if user enters more than one space between the words. i think of implementing it using subscript, but there should be easier way.
any ideas?
any ideas?
Due to lack of freedom of speech, i no longer post on this website.
•
•
Join Date: Jan 2008
Posts: 2,052
Reputation:
Solved Threads: 118
wow it worked :
the output is 3 as expectedly.
now the question for you, how were you able to find this information?
C# Syntax (Toggle Plain Text)
string something = "ali veli deli"; string[] somethings = something.Split(new char[]{' '}, StringSplitOptions.RemoveEmptyEntries); Response.Write(somethings.Length.ToString());
now the question for you, how were you able to find this information?
Last edited by serkan sendur; Apr 26th, 2009 at 10:36 pm.
Due to lack of freedom of speech, i no longer post on this website.
•
•
Join Date: Aug 2008
Posts: 83
Reputation:
Solved Threads: 18
I found it in the class library reference at the MSDN. http://msdn.microsoft.com/en-us/library/ms229335.aspx
•
•
Join Date: Jan 2008
Posts: 2,052
Reputation:
Solved Threads: 118
i found it :
C# Syntax (Toggle Plain Text)
foreach (DataGridViewRow dr in DataGridName.SelectedRows) { dr.Selected = false; }
Due to lack of freedom of speech, i no longer post on this website.
![]() |
Similar Threads
- HOw to sort the array of strings in c in alphabetical order of words.. (C)
- Searching for words in a file (C++)
- Anagrams (C++)
- Dr scheme help -> breaking strings into individual words (Computer Science)
- Is it possible to arange lines in a file alphabetically? (C)
- Display Longest and Shortest Word in a String (C++)
- word count in borland c++ ?? (C++)
- Ideas needed for problem with trailing whitespaces (C++)
- redefinition error please help (C++)
- Read and write to an ASCII Text file (Java)
Other Threads in the C# Forum
- Previous Thread: Videofile Manipulation
- Next Thread: Database railway reservation system
| Thread Tools | Search this Thread |
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# check checkbox client color combobox control conversion csharp custom cyclethruopenforms data database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file finalyearproject form format forms function gdi+ getoutlookcontactusinfcsvfile globalization httpwebrequest image index input install installer java label list listbox mandelbrot math mono mouseclick mysql operator path photoshop picturebox pixelinversion post programming radians regex remote remoting richtextbox save serialization server sleep socket sql sql-server statistics stream string table text textbox thread time timer timespan update upload usercontrol users validate validation visualstudio webbrowser windows winforms wpf xml






