Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK Beginning Lua Programming ISBN: 978-0-470-06917-2
This is the forum to discuss the Wrox book Beginning Lua Programming by Kurt Jung, Aaron Brown; ISBN: 9780470069172
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK Beginning Lua Programming ISBN: 978-0-470-06917-2 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old October 8th, 2011, 07:23 AM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default string comparison

I've tried to master your though very clear "using strings" chapter, but it's still a bit confused

I only wish to do the following with two strings :
subject = "abcdeabcde"
pattern= "cbaaaf"
comparison(subject,pattern)
and then get
- pattern letters found in subject, getting : 4 cbaa
- subject letters missing in pattern, getting : 6 debcde

My strings are lower letters only, I don't care about letters order in my results.
What I really wish to do is to go through the subjectstring and get the following answer for each letters : isinPattern or isnotinPattern. The problem is that I don't know how to tell, once a letter in pattern has been "used" for comparison", not to look at it again :
When I reach the first c (abCdeabcde) in the subject, I should get OK, but when I reach the second c (abcdeabCde), I should get Not in pattern (since there is only one c in my pattern)...
Hoping I'm clear


On the other hand you provide a cool strtoarray function. Maybe I should convert my string to table then try to compare them...


Similar Threads
Thread Thread Starter Forum Replies Last Post
String comparison arnabghosh Classic ASP Professional 1 June 29th, 2006 06:01 AM
Fuzzy string comparison (2) kobus XSLT 2 October 11th, 2004 07:28 AM
fuzzy string comparison kobus XSLT 0 September 22nd, 2004 05:47 AM
Please Help - Tricky String Comparison ank2go SQL Server 2000 1 February 6th, 2004 09:57 PM
String Comparison rylemer Pro VB 6 9 July 29th, 2003 06:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.