Need to select the 11 numbers before the 2 last numbers
11 numbers before the number 30
Need to select the 11 numbers before the 2 last numbers
11 numbers before the number 30
Hi,
Could you please try with substring function in string manipulation like below.
substring(startindex,length) to achieve your goal.
In our case yourstring.substring(7,11)
Hey
We can use Regex to accomplish this.
Please tell us some more so we can help
Is the 30 alway there?
What is the length of the digits in the middle?
Will there always be capital letters at the start and a letter at the end?
I have created a starter Regex pattern to assist.
Please check out my Regex MegaPost if you want to learn Regex.
Thank you for your reponse.
The all sentence can change, 30 is not always there but the 2 last number are always numbers
In the all sentence it can have letters or not. The lengh is always more than 11 numbers
so what i need is a regex that removes the last 2 digits then gets the 11 digits before the last 2 digits. In my example, take the 11 digits before the number 30
Oh sorry i need to take also the letters
Which letters sorry
Will they always be capitals also?
Try this pattern:
[A-Z]+\d{11,}[A-Z]+(?=\d{2})
With is example it will be better :
Code banque : 30002
Code guichet : 00550
Numéro de compte : 0000157841Z
Clé rib : 25
Is it not easier to use substring ?
The structure is always the same even if we change the numbers or letters
Hi,
One last try with the substring fucntion.
First replace the space with the empty → stringvalue.Replace(" “,”")
Next substring to get the desired string irrespective if length.
→ Stringvalue.Substring(cint(Stringvalue.Length-13),11)
Could you please try and let me know. thanks
I am getting the correct output. could you please review the attached work flow. thanks.
SubstringDemo.zip (2.2 KB)
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.