Click here to Skip to main content
15,916,379 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Convert/Read SQL Image field into pdf Pin
Richard MacCutchan20-Jul-23 4:32
mveRichard MacCutchan20-Jul-23 4:32 
AnswerRe: Convert/Read SQL Image field into pdf Pin
jschell22-Aug-23 6:56
jschell22-Aug-23 6:56 
GeneralScanner Device Pin
Mateo Francisco18-Jul-23 20:50
Mateo Francisco18-Jul-23 20:50 
AnswerRe: Scanner Device Pin
Ralf Meier18-Jul-23 21:15
mveRalf Meier18-Jul-23 21:15 
GeneralRe: Scanner Device Pin
Victor Nijegorodov19-Jul-23 2:04
Victor Nijegorodov19-Jul-23 2:04 
QuestionAll digits in string after W Pin
Dennis B. Muth6-Jul-23 19:41
Dennis B. Muth6-Jul-23 19:41 
AnswerRe: All digits in string after W Pin
Richard MacCutchan6-Jul-23 22:01
mveRichard MacCutchan6-Jul-23 22:01 
AnswerRe: All digits in string after W Pin
Richard Deeming6-Jul-23 22:01
mveRichard Deeming6-Jul-23 22:01 
Simple enough:
VB.NET
Dim source As String = "202205W24"
Dim index As Integer = source.IndexOf("W"c)
Dim result As String = If(index = -1, String.Empty, source.Substring(index + 1))
This will return the string after the first "W" character, or an empty string if there isn't a "W".

If the source could contain multiple "W" characters, and you want to return the string after the last "W", use LastIndexOf instead of IndexOf.

String.IndexOf Method (System) | Microsoft Learn[^]
String.LastIndexOf Method (System) | Microsoft Learn[^]
String.Substring Method (System) | Microsoft Learn[^]
If Operator - Visual Basic | Microsoft Learn[^]



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: All digits in string after W Pin
jschell7-Jul-23 11:49
jschell7-Jul-23 11:49 
GeneralRe: All digits in string after W Pin
Richard Deeming9-Jul-23 21:16
mveRichard Deeming9-Jul-23 21:16 
GeneralRe: All digits in string after W Pin
jschell10-Jul-23 3:34
jschell10-Jul-23 3:34 
QuestionCURL POST request in VB.NET (json) Pin
Member 118569042-Jul-23 20:02
Member 118569042-Jul-23 20:02 
AnswerRe: CURL POST request in VB.NET (json) Pin
Andre Oosthuizen3-Jul-23 0:38
mveAndre Oosthuizen3-Jul-23 0:38 
GeneralRe: CURL POST request in VB.NET (json) Pin
Member 118569043-Jul-23 22:37
Member 118569043-Jul-23 22:37 
GeneralRe: CURL POST request in VB.NET (json) Pin
Andre Oosthuizen3-Jul-23 23:22
mveAndre Oosthuizen3-Jul-23 23:22 
Questionrecord device!! Pin
Member Alienoiz19-Jun-23 6:31
Member Alienoiz19-Jun-23 6:31 
AnswerRe: record device!! Pin
Richard MacCutchan19-Jun-23 6:50
mveRichard MacCutchan19-Jun-23 6:50 
GeneralRe: record device!! Pin
Member Alienoiz19-Jun-23 7:08
Member Alienoiz19-Jun-23 7:08 
GeneralRe: record device!! Pin
Member Alienoiz19-Jun-23 8:30
Member Alienoiz19-Jun-23 8:30 
GeneralRe: record device!! Pin
Richard MacCutchan19-Jun-23 9:12
mveRichard MacCutchan19-Jun-23 9:12 
GeneralRe: record device!! Pin
Member Alienoiz19-Jun-23 9:34
Member Alienoiz19-Jun-23 9:34 
AnswerRe: record device!! Pin
Ralf Meier20-Jun-23 4:05
mveRalf Meier20-Jun-23 4:05 
QuestionListbox Highlight color! Pin
Member Alienoiz18-Jun-23 5:26
Member Alienoiz18-Jun-23 5:26 
AnswerRe: Listbox Highlight color! Pin
Richard MacCutchan18-Jun-23 5:40
mveRichard MacCutchan18-Jun-23 5:40 
GeneralRe: Listbox Highlight color! Pin
Member Alienoiz18-Jun-23 6:00
Member Alienoiz18-Jun-23 6:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.