How do I take a scraped string number and add more numbers numbers to it?

Hey there,

I’m scraping a number from an email (which I’ve done successfully) as a string. I need to add another 1 digit to this, but I am having trouble with how I would code that. So let me explain:

The number I am scraping in this case is 35 (which is a variable as it changes with each email) and I need to add 1 to this to make it 36. I’ve used string conversion and an assign to get this information from the email: (those with ‘p’ are variables).

The email markers are an int32 and use an index to mark the words in between that which needs to be scraped, I then trim this to get rid of white space. How would I then +1 to the below?

pEmailName.SubString(pEmailMarker1,pEmailMarker2-pEmailMarker1).Trim.Split(" "c)(3)

Thanks for your help.


First convert your scraped result into integer and then add +1 to it as below.

    CInt(pEmailName.SubString(pEmailMarker1,pEmailMarker2-pEmailMarker1).Trim.Split(" "c)(3).ToString)+1


Hope the below rdp would help you resolve this

Stroutput = Convert.ToInt32(Split(pEmailName.SubString(pEmailMarker1,pEmailMarker2-pEmailMarker1).ToString.Trim,” “)(3).ToString.Trim).ToString

This will give you back 36 or any number after adding 1, as a string
If you want as integer then remove the last part .ToString

Cheers @dr1992

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