Hi,
I have a string "hello [world] this {is} a (test)" I want to remove all text in braces, e.g. returning "hello this a". But only if the braces match.
Anyone have a nice neat solution?
I could have sworn I used a chr() function 40 minutes ago but can't find the file. I know it can go up to 256 so I use this:
std::string chars = "";
chars += (char) 42; //etc
So that's alright, but I really want to access unicode characters. Can I do (w_char) 512? Or maybe something just like the unichr() function in python, I just can't find a…
How print format string passed as argument ?
example.cpp:
#include <iostream>
int main(int ac, char* av[])
{
printf(av[1],"anything");
return 0;
}
try:
example.exe "print this\non newline"
output is:
print this\non newline
instead I want:
print this
on newline
What is the smartest way of searching through an array of strings for a matching string in Perl?
One caveat, I would like the search to be case-insensitive
so "aAa" would be in ("aaa","bbb")
Is there a clean, preferably standard method of trimming leading and trailing whitespace from a string in C? I'd roll my own, but I would think this is a common problem with an equally common solution.
I have an InputStreamReader object. I want to read multiple lines into a buffer/array using one function call (without crating a mass of string objects). Is there a simple way to do so?
char *myfunc() {
char *temp = "string";
return temp;
}
In this piece of code, where does the allocation of the object pointed to by temp happen and what would be its scope?
Is this function a valid way to return a char* pointer?
When would you ever want to scope a String Builder inside a for loop?
Sample Code:
....
for (int i=0; i<cnt; i++) {
....
{
StringBuilder sb = new StringBuilder();
sb.append(",");
....
}
}
....
I have a wstringstream:
wstringstream sstream;
AlterSstream(sstream);
sstream << "foo";
MessageBoxW(
NULL,
sstream.str().c_str(),
L"subject",
MB_OK
);
This outputs a long string that looks nothing like what I put in it in AlterSstream():
00000000002CEC58foo
AlterSstream:
void AlterSstream(wstringstream& outStream)
{
…
Title says it all really. Using only XSLT 1.0's string functions, how would I go about slicing off the end of a url?
So from
http://stackoverflow.com/questions/2981175/is-it-possible-to-slice-the-end-of-a-url-with-xslt-1-0
I would like to extract
is-it-possible-to-slice-the-end-of-a-url-with-xslt-1-0
Is this possible?
When I compare two array values I see two strings that look the same. php doesn't agree.
$array1 = ('address'=>'32 Winthrop Street','state'=>'NY');
$array2 = ('address'=>'32 Winthrop Street');
$results = array_diff_assoc('$array1, $array2);
var_dump($results)
//echos ['address'] => string(18) "32 Winthrop Street"…
Hi,
I'm using the permalink_fu plugin to create permalinks from titles. My problem is: If the title contains german characters, they are just replaced with '_'.
What I need is something that replaces
ä with ae
ü with ue
ö with oe
I fount String.tr but the problem here is that it replaces 1 character with 1 replacement, so it…
I've been reading the Python 3.2 docs about string formatting but it hasn't really helped me with this particular problem.
Here is what I'm trying to do:
stats = { 'copied': 5, 'skipped': 14 }
print( 'Copied: {copied}, Skipped: {skipped}'.format( stats ) )
The above code will not work because the format() call is not…
I have several C++ strings with some words. I need to get first word from every string. Then I have to put all of them into a char array. How can I do it?
Thanks i advance!
Is there a way to change the language of the driver interface for Canon Pixma printers? Which language is used seems to be determined by the language of the OS or the Windows localization settings. I really don't want that, I want to be able to set the language manually to my own liking, either during the driver…
Hi,
I have embed the fullcalender control in my asp.net mvc application. It is running fine locally. but when I uploads it to my domain server (third party) it showing me
This Error: Uncaught TypeError: Object # has no method 'fullCalendar' in crome console (debugger). and not rendering the control.
**…
I'm trying to create a simple date class, but I get an error on my main file that says, "call of overloaded Date() is ambiguous." I'm not sure why since I thought as long as I had different parameters for my constructor, I was ok. Here is my code:
header file:
#ifndef DATE_H
#define DATE_H
using…
Hello!
I have a stupid problem. An jQuery.ajax request return me a full HTML text as a string. I receive such response in an case of error on the server. The server give me an error description which I want to place inside of the corresponding place of my current page.
So now the question: I have…
I'm trying to create a simple date class, but I get an error on my main file that says, "call of overloaded Date() is ambiguous." I'm not sure why since I thought as long as I had different parameters for my constructor, I was ok. Here is my code:
header file:
#ifndef DATE_H
#define DATE_H…
Yes. I can't see what im doing wrong
the map is string, int
Here the method
bange::function::Add(lua_State *vm){
//userdata, function
if (!lua_isfunction(vm, 2)){
cout << "bange: AddFunction: First argument isn't a function." << endl;
return false;}
void…
I try to install Perl module String::ToIdentifier::EN (as depndency of DBIx::Class::Schema::Loader) but it fails on tests. I googled those errors but get no picture, where is problem:
Building and testing String-ToIdentifier-EN-0.07
cp lib/String/ToIdentifier/EN.pm…
Below is the code from a plugin I use for sitemaps.
I would like to know if there's a way to "enforce" a different timezone on all date variable and functions in it.
If not, how do I modify the code to change the timestamp to reflect a different timezone? Say for…
Hi,
I'm writing an app to check for the bus timetable's. Therefor I need to post some data to a html page, submit it, and parse the resulting page with htmlparser.
Though it may be asked a lot, can some one help me identify if
1) this page does support post/get…