Jump to content

llParseString2List - splitting regardless of capitalization?


You are about to reply to a thread that has been inactive for 4121 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts


Darkie Minotaur wrote:

if you dont care to loose case information, you could simply do a llToLower on the string

No, thanks. I do need to keep all the Uppers etc. Looks like it'll have to be a copy of the string to lower case, then get offset, then use offset in Orig string to break into list items etc.

 

Link to comment
Share on other sites


Domitan Redenblack wrote:

Ah, yes, but suppose the separator is a Region name? With say 22 letters? "Sub-Antarctic SnowZone" etc

Could you give us an example of a typical string you would like spitting into three list entries?   It may be possible to discern a pattern there you haven't noticed.

Link to comment
Share on other sites

I have a database of a long string of region names and sales data, returned via llGetHTTP etc.

The first element of each "record" is the name of a region in SL. I have a HUD which does MySQL requests for this long string of data, which is returned in a single string. I need to divide up the records by the region name. The agent who uses the HUD may not have capitalization right, which doesn't bother MySQL, but llParseString2List() *does* care about capitalization of the region names.

So if an agent searches the database for a region name, but get capitalization wrong, the data is returned but I can't parse it. So, I was looking for a way to break up the string into records, by region name, but without paying attention to capitalization, etc.

I can require agents to get capitalization correct, but was curious about Parsing strings based on break-strings which ignore capitalization.

My proposed solution may be the only way. Just curious if you might suggest other ways to parse strings when capitalization is irrelevant.

ty

 

Link to comment
Share on other sites

clean? no...

you can keep the original string as a separate list for reporting to the user, lowercase the incoming region names separately for matching, but that only gives you case insensitivity and not partial match. to do partial matching you'd have to either loop through the list or keep it as one string and try to get a match that way.... it's always going to be dirty and slow to do more than simple matching in lsl.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4121 days.

Please take a moment to consider if this thread is worth bumping.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...