Hi hazel14,
Use ARRAY_AGG and REPLACE functions in Sybase.
For more details refer below links.
https://www.postgresqltutorial.com/postgresql-aggregate-functions/postgresql-array_agg/
https://www.postgresqltutorial.com/postgresql-string-functions/postgresql-replace/