KC,
First, if the column is a string, you can most likely just cast it to a
string. Calling ToString is superfluous:
string tmpFirstName = (string) tmphashtable["FIRST_NAME"];
Then, you can call the Split method on the string, and get an array of
the parts delimited by whatever you choose. In this case, it would be a
space.
// The parts.
string[] parts = tmpFirstName.Split(new char[]{' '});
The first name would be in the array at index 0 then.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Netmonster" <ne***********@yahoo.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
Hello all,
I am creating a string based on data returned from an oracle db into a
hashtable.
string tmpFirstName = tmphashtable["FIRST_NAME"].ToString();
The Database has a column called FIRST_NAME but the return also has the
middle initial so my string look something like this "FirstName M" I
don't need the M. Can nay one show me an example on how to parse the
space and the M from the string to just get the FirstName?
Thanks,
KC