Substring error with 2 lines

I have a text with 2 lines when i use get text

text : Commerce de gros (commerce interentreprises) de sucre, chocolat et confiserie
(4636Z)

I tried with the sentence below but the result is nothing, i think it takes only the first line.

APE.Substring(CInt(APE.Length-6),6).Replace(")","")

I need to get only ==> (4636Z)

here the website if you want test : JEFF DE BRUGES DIFFUSION (FERRIERES-EN-BRIE) Chiffre d'affaires, résultat, bilans sur SOCIETE.COM - 448989947

Hi @Soudios,

When I tried the get text activity it returned this :

Commerce de gros (commerce interentreprises) de sucre, chocolat et confiserie (4636Z)

It was not split over 2 lines,the selector used was ("<webctrl id='ape-histo-description' tag='DIV' type='' />")

However, if you are trying to return only that information, I would recommend Regex

You can use this "(\(\w+\))"

1 Like

@TimK

It works but i need to remove () from the result i just need 4636Z

Fine

If you want only the value between braces then use this

(\d+[a-zA-Z]+)

If you want with braces
(\W\d+[a-zA-Z]+\W)

We can mention this in a expression like this

Stroutput = System.Text.RegularExpressions.Regex.Match(strinput.ToString,”above expression”).ToString

Cheers @Soudios

1 Like

Try this "\s\((\w+)\)$"

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.