Hi,
I have a list of strings which I want to remove from a super set of another strings, not in a any specific order and thus constructing a new set. Is that doable in Bash?
...
Hi,
I have been looking for a way to create a function to check if a string contains anything other than lower case letters and numbers in it, and if it does return false. I have searched on the internet but all I can find is old methods that require you to use functions that are now deprecated in PHP5.
So how do we do it in PHP5?
...
I need to replace a dynamic substring withing a larger string, but only once (i.e. first match). The String class provides only replace(), which replaces ALL instances of the substring; there is a replaceFirst() method but it only takes regexp instead of a regular string. I have two concerns with using regex:
1) my substring is dynamic...
I am trying to come up with an algorithm to compare two strings. It would register a match any words that contain the same letters. For example rent and tern would be equivalent because they both contain the letters r,e,n,t.
EDIT I apologize for being so vague. The comparison is going to be made on two sets of a few thousands of words h...
How can I count the number of characters within a string and create another string with the same number of characters but replace all of them with a single character such as "*"? Thank you.
...
I am getting this error: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\wamp\www\vacation_showcase\admin\participants_edit_list.php on line 17
This is my sql statement:
$sql = 'SELECT substring_index(description,' ',100) as preview, name, extra_line, link FROM participants
ORDER BY name
ASC';
I dont know why...
I am stumped by the behaviour of the following in my Win32 (ANSI) function:
(Multi-Byte Character Set NOT UNICODE)
void sOut( HWND hwnd, string sText ) // Add new text to EDIT Control
{
int len;
string sBuf, sDisplay;
len = GetWindowTextLength( GetDlgItem(hwnd, IDC_EDIT_RESULTS) );
if(len > 0)
{
// HERE:
sBuf.resize(le...
How do I print a hash from within a string, as in
print "\n[*] Query : $select { query }";
versus
print "\n[*] Query : " . $select { query };
...
I'm using an STL Queue as an input queue, it's containing std::strings, which I have aliased as String using a typedef. I'm reading the input string off a socket - using Berkeley sockets. It is read into a char buffer array and then used to set a string which is passed to the queue. It only happens for the input queue - the output que...
While I like programming in C++, I hate the idea of:
std::basic_string vs QString vs wxString vs .............
Doesn't the standard string class satisfy the needs for these frameworks? I mean what is wrong with the standard string class?!
Just to emphasize, that below is the important question:
Do you learn "the" string class of the fra...
I've got a huge tuple of strings, which are being returned from a program. An example tuple being returned might look like this:
('(-1,0)', '(1,0)', '(2,0)', '(3,0)', '(4,0)', '(5,0)', '(6,0)')
I can convert these strings to real tuples (with integers inside), but i am hoping someone knows a nice trick to speed this up. Anything i've ...
How do I define a minimum and maximum (possibly unbounded) number of times a certain pattern should repeat itself? I know there's ? and *, with which I could build the pattern by repeating it a certain amount of times, but I know there's a special notation for it using {}, I just can't remember how it is.
...
I use a negative index in replacement fields to output a formatted list,but it raises a TypeError.The codes are as follows:
>>> a=[1,2,3]
>>> a[2]
3
>>> a[-1]
3
>>> 'The last:{0[2]}'.format(a)
'The last:3'
>>> 'The last:{0[-1]}'.format(a)
Traceback (most recent call last):
File "", line 1, in
TypeError: list indices must be integers...
Hi all,
I need to replace all system. environment.newline (s) in the string returned by my function with "System.Environment.Newline + \t" (i'm trying to apply indenting) and I need to do this several times .
now my question is which one is the fastest way to do this ?
I know that stringbuilder is faster than string.replace but I dont k...
Hello, I am not a very experienced C++ programmer, i get a warning when i do the following:
if (myString[i] != 'x')
{
}
what is the appropriate way to compare these?
thanks for your help!
...
For example, if I had the following string:
"this-is-a-string"
Could I split it by every 2nd "-" rather than every "-" so that it returns two values ("this-is" and "a-string") rather than returning four?
...
for (int i = len-2; index>= 0; index --)
...
I'm writing a program which is supposed to read two strings that can contain line breaks and various other characters. Therefore, I'm using EOF (Ctrl-Z or Ctrl-D) to end the string.
This works fine with the first variable, but with the second variable, however, this seems to be problematic as apparently something is stuck in the input b...
I'm stuck on part of my homework, I had to find the rightmost occurrence of a substring inside of a string. I have the first part done (can find substring in single word strings), but now I am having trouble with the second part. I have to use a modified version of getline in order to allow multi-word strings (aka with spaces). Here's...
If a Ruby regular expression is matching against something that isn't a String, the to_str method is called on that object to get an actual String to match against. I want to avoid this behavior; I'd like to match regular expressions against objects that aren't Strings, but can be logically thought of as randomly accessible sequences of ...