HOME IRC
gelignite
Promotion
Nutzloses Wissen
Deine IP:
3.133.154.106

Dein Host:
ec2-3-133-154-106.us-east-2.compute.amazonaws.com

Seitenaufbau dauerte:


Aktuelle Uhrzeit (UTC):
18-04-2024 11:29:39

Letzten Lottozahlen [?]:
9, 16, 34, 37, 40, 47
SZ: 2
Tipps und Tricks
zurück

Batch programming - Find a string in a string (i.e. substring)


Direct link:
Tips und Tricks #15
Bezug:
DOS (Microsoft)

Details:
Batch programming isn't really great fun. So, if you get here you are looking for a way to find a string in another string, i.e. check whether a string contains another. And you are searching for a long time already, aren't you?

Don't waste any more time! Here is your solution:
  set search=foo
set string=lol foobar roflmao

echo %string% | find "%search%" >nul
if not errorlevel 1 (
echo %string% contains %search%
) else (
echo %string% does NOT contain %search%
)
Happy programming!
Letzte Meldungen
13.08.2011 - Counter-Strike GO ...[more]

10.04.2011 - Monday Night Combat ...[more]

25.02.2011 - Humorvolles ...[more]

23.01.2011 - 1.5 GHz, 3 GB Speicher, ... ...[more]

20.01.2011 - Liste der QuakeNet Achievements und wie man sie bekommt bereitgestellt ...[more]

31.12.2010 - Guten Rutsch ...[more]

16.12.2010 - gelignAIte - Official Release ...[more]

11.11.2010 - openTTD AI ...[more]

26.10.2010 - Zeitreisen scheinen möglich ...[more]

04.09.2010 - Abschaltung "index.php4" ...[more]

Umfrage
Lieber ATI oder NVidia?

Legal notes
© 2000 - 2021 The Black Eagle Eyes, Alle Rechte vorbehalten