Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

C# Soundex reducing adjacent pairs

$
0
0

Hi there ,

I am new to programming and I was wondering if there was a way to  reduce adjacent pairs in an array

int[] numbers = {1,1,1,1,1,1,1,1,1,1,1,1 2,2,2,2,2,2, 3,3, 4, 5, 4, 5};

into 1,2,3,4,5,4,5??
I’ve tried searching for tutorials but to no avail
could I convert the array into a string and use some sort of a loop which includes length -1 to remove the extra characters or maybe a union would be more appropriate to merge the extra characters

Apologies if this doesn’t make sense – im not quite sure how to explain it…..


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>