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

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

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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.