Search found 3 matches
- 28 Apr 2017 07:38
- Forum: DOS Batch Forum
- Topic: Test whether a string contains another string
- Replies: 7
- Views: 31277
Re: Test whether a string contains another string
@penpen and @ShadowThief, thanks for the information. @Compo, thank you for your suggestion. I have now discovered that the procedure in my case does not work because it takes place in a "for" loop in a batch file. I solved the problem by executing the string comparison in a subroutine. An...
- 27 Apr 2017 15:10
- Forum: DOS Batch Forum
- Topic: Test whether a string contains another string
- Replies: 7
- Views: 31277
Re: Test whether a string contains another string
What am I doing wrong? String replacement sometimes could be tricky. In your case the expansion of (the second) "StringA" variable ends at the percentage sign character right after the double colon; in this case there is no string operation because the part after the colon is missing, so ...
- 27 Apr 2017 07:42
- Forum: DOS Batch Forum
- Topic: Test whether a string contains another string
- Replies: 7
- Views: 31277
Test whether a string contains another string
Hi, I want to test in a batch file whether a string contains a different string. For some reason, it is not possible to get the search string properly in the formula. I have two variable that contain the strings: set StringA=aba d25 c9.8 v23 set SearchString=9.7 Then i do the test: If NOT "%Str...