I will suggest, that encoding multiple values in a string just creates more problems (parsing and extracting types).
The suggested methods are common ways to return multiple values in a language without simple tuple syntax (tuple means arbitrary number of grouped terms, not just 2). I would suggest the standard way of returning a complex typed object.
MyTypedObject returnVal = {
int x: 0,
int y: 2
};
This gets messy when you have lots of functions trying to return multiple values, because now you have a whole bunch of types to namespace and modify when you want to make changes.
A tuple substitute is implementing a kind of intentionally-formed complex object. This gives birth to the "wheel" or whatever you want to call it.
Let's say we have another function where we want to return a string and an int. Modify the wheel to allow those values to be carried.
// MyTypedObject becomes Wheel - or ad-hoc tuple
Wheel returnVal = {
int x,
int y,
string z
};
Now I can use the wheel to return multiple values across multiple functions. You do have to be careful to ensure that only set returned value fields are used, but it makes the code MUCH cleaner when used sparingly. Generally, if you are returning more than a handful of fields, you want a dedicated SomeTypedObject, but for simple things the Wheel will do.
};