[Javascript] Comparing Strings

Shawn Milo shawn.milo at gmail.com
Thu Aug 25 07:48:22 CDT 2005


Sure, here you go:

  function stripNshrink(someText){

  	someText = someText.replace(/(\n+|\s+|\t+)/g, '').toLowerCase();
  	return someText;

  }




On 8/25/05, Timothy White <weirdit at gmail.com> wrote:
> On 8/25/05, Shawn Milo <shawn.milo at gmail.com> wrote:
> > Maybe you could make them both lower-case and remove all whitespace
> > (including newlines, tabs, spaces, etc.) for the comparison. Unless
> > you can think of a situation where you'd want to see a  difference in
> > the whitespace as a valid difference.
> 
> Do you have some code? I think that it's only a white space problem.
> I'm not a good javascript programmer yet, my forte is C, PHP and Perl.
> 
> Thanks
> 
> Tim
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
> 


-- 
Shawn Milochik

The Freelance Pen
FreelancePen.com
610-621-2648



More information about the Javascript mailing list