0

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

1
Contributor
3
Replies
4
Views
9 Years
Discussion Span
Last Post by harkw002_UniSA
0

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

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

0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.