Click here to Skip to main content
15,791,740 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Convert/Read SQL Image field into pdf Pin
Richard MacCutchan20-Jul-23 5:32
mveRichard MacCutchan20-Jul-23 5:32 
AnswerRe: Convert/Read SQL Image field into pdf Pin
jschell22-Aug-23 7:56
jschell22-Aug-23 7:56 
GeneralScanner Device Pin
Mateo Francisco18-Jul-23 21:50
Mateo Francisco18-Jul-23 21:50 
AnswerRe: Scanner Device Pin
Ralf Meier18-Jul-23 22:15
professionalRalf Meier18-Jul-23 22:15 
GeneralRe: Scanner Device Pin
Victor Nijegorodov19-Jul-23 3:04
Victor Nijegorodov19-Jul-23 3:04 
QuestionAll digits in string after W Pin
Dennis B. Muth6-Jul-23 20:41
Dennis B. Muth6-Jul-23 20:41 
AnswerRe: All digits in string after W Pin
Richard MacCutchan6-Jul-23 23:01
mveRichard MacCutchan6-Jul-23 23:01 
AnswerRe: All digits in string after W Pin
Richard Deeming6-Jul-23 23:01
mveRichard Deeming6-Jul-23 23: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 12:49
jschell7-Jul-23 12:49 
GeneralRe: All digits in string after W Pin
Richard Deeming9-Jul-23 22:16
mveRichard Deeming9-Jul-23 22:16 
GeneralRe: All digits in string after W Pin
jschell10-Jul-23 4:34
jschell10-Jul-23 4:34 
QuestionCURL POST request in VB.NET (json) Pin
Member 118569042-Jul-23 21:02
Member 118569042-Jul-23 21:02 
AnswerRe: CURL POST request in VB.NET (json) Pin
Andre Oosthuizen3-Jul-23 1:38
mveAndre Oosthuizen3-Jul-23 1:38 
GeneralRe: CURL POST request in VB.NET (json) Pin
Member 118569043-Jul-23 23:37
Member 118569043-Jul-23 23:37 
GeneralRe: CURL POST request in VB.NET (json) Pin
Andre Oosthuizen4-Jul-23 0:22
mveAndre Oosthuizen4-Jul-23 0:22 
Questionrecord device!! Pin
Member Alienoiz19-Jun-23 7:31
Member Alienoiz19-Jun-23 7:31 
AnswerRe: record device!! Pin
Richard MacCutchan19-Jun-23 7:50
mveRichard MacCutchan19-Jun-23 7:50 
GeneralRe: record device!! Pin
Member Alienoiz19-Jun-23 8:08
Member Alienoiz19-Jun-23 8:08 
GeneralRe: record device!! Pin
Member Alienoiz19-Jun-23 9:30
Member Alienoiz19-Jun-23 9:30 
GeneralRe: record device!! Pin
Richard MacCutchan19-Jun-23 10:12
mveRichard MacCutchan19-Jun-23 10:12 
GeneralRe: record device!! Pin
Member Alienoiz19-Jun-23 10:34
Member Alienoiz19-Jun-23 10:34 
AnswerRe: record device!! Pin
Ralf Meier20-Jun-23 5:05
professionalRalf Meier20-Jun-23 5:05 
QuestionListbox Highlight color! Pin
Member Alienoiz18-Jun-23 6:26
Member Alienoiz18-Jun-23 6:26 
AnswerRe: Listbox Highlight color! Pin
Richard MacCutchan18-Jun-23 6:40
mveRichard MacCutchan18-Jun-23 6:40 
GeneralRe: Listbox Highlight color! Pin
Member Alienoiz18-Jun-23 7:00
Member Alienoiz18-Jun-23 7: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.