I need help please... someone do a favor

Nov 8, 2015
27
1
How to find % character within a string (either single or multi line) contained in a variable?
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,689
106
Albuquerque, NM
prospero.unm.edu
The percent sign is very difficult to work with, since it's used for variable expansion. SETDOS /X-4 might be helpful. Or -- more complicated, but probably more reliable -- dump the variable to a file with e.g. SET MYVAR > MYVAR.TXT and then parse the file with FIND or FFIND or sed/awk/grep or whatever.

What do you mean by "find"? Find the offset of the first percent sign in the string? The last one? Count percent signs? Or just determine whether or not the string contains a percent sign?