XP is just a number | |
PerlMonks |
Re: difference between two linesby Corion (Patriarch) |
on Jul 30, 2018 at 08:18 UTC ( [id://1219459]=note: print w/replies, xml ) | Need Help?? |
What have you tried and how did your code fail? Some ideas would be: You could remove all spaces from both lines. If they are equal, the difference was only the blank space. If you want to know if two lines only differ by exactly one blank space, check first, if the absolute difference in their lengths is 1. Then do the above check. Alternatively, split both strings on spaces and check if the resulting lists are the same.
In Section
Seekers of Perl Wisdom
|
|