string

ActionScript2: Split a text with two delimiter, Help

I try to create a project with use a Split in AC2. this I have in_pers = 3x5+5x3+6x8; var tmp:Array = in_pers.split("+"); trace(tmp); //output == 3x5, 5x3, 6x8 but, how if in_pers = 3x5+5x3-6x8-4x2; how can I get the result 3x5, 5x3, 6x8, 4x2 how to use the split with two delimiter. Best regard.. ...

Overcoming the Bitap algorithm's search pattern length

I am new to the field of approximate string matching. I am exploring uses for the Bitap algorithm, but so far its limited pattern length has me troubled. I am working with Flash, and I dispose of 32 bit unsigned integers and a IEEE-754 double-precision floating-point Number type, which can devote up to 53 bites for integers. Still, I wo...

How to convert strings numbers to integers in a list?

I have a list say: ['batting average', '306', 'ERA', '1710'] How can I convert the intended numbers without touching the strings? Thank you for the help. ...

Compare strings in haskell

I have two strings given as arguments to a Haskell function. s1 is smaller than s2 if s1 is shorter than s2 or if they have the same length and s1 is lexicographically smaller than s2. ...

What should one map strings to in a database ORM?

Strings are unbounded, but it seems every normal relational database requires that a column declare its maximum length. This seems to be a rather significant discrepancy and I'm curious how typical ORMs handle this. Using a 'text' column type would theoretically give you much more string-like storage, but as I understand it text columns...

How to bestow string-ness on my class?

I want a string with one additional attribute, let's say whether to print it in red or green. Subclassing(str) does not work, as it is immutable. I see the value, but it can be annoying. Can multiple inheritence help? I never used that. Inheriting only object and using self.value=str means I have to implement all string-ness messages ...

Format number as money

How do I format a number to look like this: 9,000 my database field is in money data type, when I pull it up I see it like this: 9000.0000 that don't look right to me (I would like it to look like a real money format) Sorry folks, forgot to mention technology it would be in C# Thanks! ...

Strip HTML from Text JavaScript

Is there an easy way to take a string of html in JavaScript and strip out the html? ...

Java string inside string to string

Hello, I have this string: "\"Blah \'Blah\' Blah\"". There is another string inside it. How do I convert that into: Blah 'Blah' Blah? (you see, unescaping the string.) This is because I get a SQL Where query: WHERE blah="Blah \'Blah\' Blah" When I parse this, I get the string above (still inside quotes and escaped.) How would I extrac...

Search inside Array for Value on a MYSQL Output

The code below doesn't seem to work or find anything on an array. I'm using "in_array" to search for the needle in the stack. I also tried exploding the contents with comma separated and won't work. Any suggestions? Also I tried "array_search". $q4 = "SELECT domain_name,slots_config.bid FROM slots_pid,slots_config,slots_sites WHERE slo...

Working with string streams?

Say i have a stringsteam in C++, and I want to do different operations to it like: Searching for a sequence of characters, Converting block of text into int (in the middle of the line), Moving the get pointer back and forth and so on. What is the standard/common way of doing this kind of things with stringstreams? ...

Can you PInvoke multibyte ANSI to a varargs? What am I doing wrong?

** MAJOR UPDATE ** I made a minor mistake but I'm still curious about exactly what is happening. The function I am calling is actually "fooV", a function with this signature: foo(const char *, const char *, EnumType, va_list) This clears up the AccessViolationExceptions I was getting, but doesn't explain why params parameters work fo...

Inverse String.Replace - Faster way of doing it?

I have a method to replace every character except those I specify. For example, ReplaceNot("test. stop; or, not", ".;/\\".ToCharArray(), '*'); would return "****.*****;***,****". Now, this is not an instance of premature optimization. I call this method quite a few times during a network operation. I found that on longer strings...

Searching a large string to see if invalid "parameter" exists

I have a large string, similar to this one: BREW pot HTCPCP/1.0 Accept-Additions: #milk;3#whiskey;splash Content-Length: 5 Content-Type: message/coffeepot I also have an array with several additions (#whiskey, #espresso, etc). What I need to do is send an error if this large string contains an addition that is NOT i...

string format with %g in C

How do I create a string so that it formats floating point numbers to have no trailing decimal point or digits when it is an integer, but to NOT switch to scientific notation for larger numbers? When I do: float myFloat= 15.6f; float myInt = 5.0f; float myLarge = 7000000.0f; sprintf(out, "my float is %g", myFloat); ...

String interpolation in Bash

My code #!/bin/bash for (( c=0; c<=1127; c++ )) do id = 9694 + c if (id < 10000); then wget http://myurl.de/source/image/08_05_27_0${id}.jpg else wget http://myurl.de/source/image/08_05_27_${id}.jpg fi done I only get ./get.sh: line 5: 10000: No such file or directory --2009-05-06 11:20:36-- http://myurl.de/source/image/08_05_27...

Testing for repeated characters in a string

I'm doing some work with strings, and I have a scenario where I need to determine if a string (usually a small one < 10 characters) contains repeated characters. `ABCDE` // does not contain repeats `AABCD` // does contain repeats, ie A is repeated I can loop through the string.ToCharArray() and test each character against every oth...

[String] vs String in .NET

I used developerfusion.com to convert a snippet of my C# code to VB .NET and I noticed the String type translated into [String]. I tried Google and Searching SO to no avail so I will ask the community is there a difference between [String] and String? And if so what is/are the difference(s)? ...

How can I delete a charcter from string in PHP ?

How can I delete a character from string in PHP ? $s = "waseem"; Are there a function like delChar($s , 2); ? which 2 is the index of the Character , I search but I didn't find anything . any ideas ? ...

Creating html attachment from xslt, encoding issues, asp.net

I am trying to create an html attachment by processing some of my xml through an xsl transform and sending it to the client. If I click "open", IE shows the html properly, but if I save the attachment and then open it in Firefox, every place there was a   I'm getting a "Â" character. I have a feeling this has to do with our encoding. Her...