Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] Comparing Strings
- From: shawn.milo at gmail.com (Shawn Milo)
- Subject: [Javascript] Comparing Strings
- Date: Thu Aug 25 07:48:25 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@xxxxxxxxx> wrote:
> On 8/25/05, Shawn Milo <shawn.milo@xxxxxxxxx> 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@xxxxxxxxxx
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
--
Shawn Milochik
The Freelance Pen
FreelancePen.com
610-621-2648
- References:
- [Javascript] Comparing Strings
- From: Timothy White
- [Javascript] Comparing Strings
- From: Nick Fitzsimons
- [Javascript] Comparing Strings
- From: Timothy White
- [Javascript] Comparing Strings
- From: Shawn Milo
- [Javascript] Comparing Strings
- From: Timothy White
- [Javascript] Comparing Strings
- Prev by Date: [Javascript] Comparing Strings
- Next by Date: [Javascript] Iframe Permission Denied
- Previous by thread: [Javascript] Comparing Strings
- Next by thread: [Javascript] Comparing Strings
- Index(es):