Read contact from StringBuilder object
I want to Read contact i.e. int from StringBuilder object. it had pdf file. I am reading using itextsharp classes. it looks like PH NO 456456121
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ankur AnkitPosted Apr 7, 2016, 12:12 PM
http://stackoverflow.com/questions/4711134/itextsharp-text-extraction
Note that, I didn't try iTextSharp myself before, but I am getting the text from PDF files using PDFdocument features using leadtools.
If the problem is with getting the numeric text (numbers) from the original string, try this code:
/****************************************************/
StringBuilder sb = new StringBuilder();
sb.Append("PH NO 456456121");
int _lastspaceindex = sb.ToString().LastIndexOf(' ');
string numeric_str = sb.ToString().Substring(_lastspaceindex, sb.Length - _lastspaceindex).Trim();
Console.WriteLine(numeric_str);
/****************************************************/
Joginder BangerPosted Mar 30, 2016, 3:26 PM