Extract partial string/bytes

nick007

Member
Joined
Nov 11, 2017
Messages
8
Programming Experience
Beginner
now next thing i need to do is

separate a spring


I need to extract all the different colour sections and put them into variables so i can display them as textnow next thing i need to do is

separate a spring

F2,98,1,4,5,7E,79,37,C,0,0,0,0,1,0,0,0,0,0,4,6B,48,17,F4,0,C8,0,0,FF,C0,3C,0,5,3,0,0,0,5,DC,0,0,0,0, 0,1,50,79,7C,7E,7E,7E,4,0,60,80,78,5,40,80,C0,FF,5,5A,64,5A,5,4,1C,2


I need to extract all the different colour sections and put them into variables so i can display them as text
 
Please keep each thread to a single topic and each topic to a single thread. I have split out your new question to its own thread.

As for the question, "the different colour sections" is meaningless because both the original bytes and the string you created from them have no colour. If you're going to write code to extract some elements from an array or a substring from a string then you have to know what the rules are. That is usually going to be the number of parts to skip and then the number of parts to take or the type of parts to skip and the type of parts to take. That is what the code will be based on so that's what you have to make clear.

Also, it would make sense to get those sections from the original byte array rather than the string. In that case, you can use the actual Skip and Take or SkipWhile and TakeWhile methods to get just the parts you need, then use the same technique as you already are to turn those smaller byte arrays into strings.
 

Latest posts

Back
Top Bottom