String Manipulation - Extract fields from PDF by knowing exact Indexes

Instead of running through a loop, you can just use the .Split twice…
PdfContent.Split({"Name: "},StringSplitOptions.None)(1).Split(Environment.Newline(0))(0)

or just use Regex, which is more powerful.
Regex.Match(PdfContent, "(?<=(Name: ))(.+)").Value

Regards.

3 Likes