LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Getting the no repeated pairs out of a a string (https://www.linuxquestions.org/questions/programming-9/getting-the-no-repeated-pairs-out-of-a-a-string-705264/)

charlitos 02-17-2009 01:13 AM

Getting the no repeated pairs out of a a string
 
Is there any command in C(no c++) that takes a string as a parameter and returns a string with the no repeated pairs.

for instance

the string : teststring, should return

te es st ts tr ri in ng

instead of

te es st ts st tr ri in ng

the spaces are just for illustrative purpose and to get the idea of what Im trying to get here.

thanks in advance.

Hko 02-17-2009 02:49 AM

Wouldn't it be a bad homework assignment if there were a ready-made builtin function available?

charlitos 02-17-2009 02:52 AM

That assignment has kept me up for 3 days now, thats just the foundation so I thought there might be some way to do it easier, basically cause my prof has been insisting, asking us to include these and those libraries. So i was wondering.


All times are GMT -5. The time now is 09:11 AM.