954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Convert object of type string to a string

1. How do i convert an object (students) which is of type string into a string.
2. How do i remove all characters from a string after a space character.

ie. i want to read an Object eg. "WILSON","MBCP" convert it to a string and then remove "MBCP". Then i will be left with "WILSON".

If there is a simpler way to do it. I would like to know how.

Thanks

harkw002_UniSA
Newbie Poster
10 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

Do i need to do a type conversion on the object. ie. static students* Convert(string StudInfo);

harkw002_UniSA
Newbie Poster
10 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

I have tried to convert newStudentInfo which is an object into StudInfo which is a string.

string StudInfo = newStudentInfo;

I get an error conversion from const Student to no-scalar type

harkw002_UniSA
Newbie Poster
10 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

Solved it myself. Called another funcion that i have created to get the name from the object.

harkw002_UniSA
Newbie Poster
10 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You