Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #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...
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 08:57 PM
String Comparison rylemer Pro VB 6 9 July 29th, 2003 06:49 AM



All times are GMT -4. The time now is 07:55 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.