2021年3月18日星期四

How do I select 3 character in a string after a specific symbol

Ok, so let me explain. I have some string like this : "BAHDGF - ZZZGH1237484" or like this "HDG54 - ZZZ1HDGET4" I want here to select the triple Z (that are obviously 3 differents character but for the example I think it's more comprehensible for you).

So, my problem is the next : The first part has a modulable length but i can just ignore it, I need something to take the triple Z so I was thinking about something that can "slice" my string after the " - ".

I started to try using "partition" but I just failed lamentably. I just get kinda lost with the news 3 array and then take the first 3 letter of one of the array, well, it seems very complicated and i think I'm just passing by an obvious solution that I can't find actually. It's been something like 2 days that i'm on it without anything in my mind that can help me, sort of blank page syndrome actually and I really need a little help to unlock this point.

https://stackoverflow.com/questions/66700817/how-do-i-select-3-character-in-a-string-after-a-specific-symbol March 19, 2021 at 08:03AM

没有评论:

发表评论