let's say 334536999902920193
123 445465781
Id = left(d,3)
location = mid(d,4,9)
as you can see that my substring is empty..... what's the proper code for it? If you can help me .... please
let's say 334536999902920193
123 445465781
Id = left(d,3)
location = mid(d,4,9)
as you can see that my substring is empty..... what's the proper code for it? If you can help me .... please
and : good progress — the substring "looks empty" when it actually contains characters that are not plain spaces. Trim will remove ordinary spaces and solve many cases (as noted), but other bytes can make a substring appear blank: non-breaking spaces, nulls, tabs, zero‑width spaces or other control / Unicode characters. These do not disappear with a simple Trim and will make length checks misleading unless you inspect character codes.
Quick diagnostics: check the extracted value's length and print each character code to see what is present. Example (VB.NET):
' VB.NET diagnostic
Dim subStr As String = extractedValue
Console.WriteLine("Length: " & subStr.Length)
For i As Integer = 0 To subStr.Length - 1
Console.WriteLine(i & ": " & Convert.ToInt32(subStr(i)))
Next If codes show 0, 9, 160, 8203, etc., remove or normalize them. Remedies:
String.IsNullOrWhiteSpace for whitespace tests; remove control chars via LINQ or Char.IsControl; replace NBSP (ChrW(160)) or zero‑width spaces explicitly.Asc and remove offending codes with Replace(s, Chr(code), "") or build a new string skipping Asc values below 32 (except allowed ones).Caution: only strip characters you know are not meaningful for your data source. If the input comes from files or external systems, fix the producer when possible to avoid hidden characters at source.
Jump to Post— QVeen72 104Hi,
ur code looks alright here...
Where is ur SubString..??Regards
Veena
Hi,
ur code looks alright here...
Where is ur SubString..??
Regards
Veena
it's actully look like this , but i dint realise it ...anyway ive already got it using trim()
334536999902920193
???????123 445465781
???? is my sub string but it's empty....
thanks veena
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.