string

Regex replace all except of this string

Hi ! I have a XAML document and I want to select all texts with Regex with this form: Default=xyz} I wrote for it this very simple regex and it works: Default=.+} Now, how do I exactly the opposite? I want to delete all other text than this in the document. I'm using Notepad++. Thanks ...

How do I assign a numerical value to each uppercase Letter?

How do i assign a numerical value to each uppercase letter, and then use it later via string and then add up the values. EG. A = 1, B = 2, C = 3 (etc..) string = 'ABC' Then return the answer 6 (in this case). ...

Remove empty lines

I have large string which I split by newlines. How can I remove all lines that are empty, (whitespace only)? pseudo code: for stuff in largestring: remove stuff that is blank ...

PHP Parse error: syntax error, unexpected T_CONCAT_EQUAL

$XMLFormatedString .= "<Filter id='" .= .$row->id. .="' name='" .= .$row->label. .="'><Label>" .= .$row->label. .="</Label></Filter>"; ...

string replace using a List<string>

I have a List of words I want to ignore like this one : public List<String> ignoreList = new List<String>() { "North", "South", "East", "West" }; For a given string, say "14th Avenue North" I want to be able to remove the "North" part, so basically a function that would r...

PHP shortest/longest string in array

I have an array like this $data = array( "163", "630", "43", "924", "4", "54" ); How can I select the smallest and largest values from it according to string length NOT number value. (for this example it is 1 (smallest) and 3 (largest). ...

parsing out in javascript

I want to check a string and if it has no <br /> starting then I don't wanna do any thing for example mysqtinr = 23435-acs as you can see no <br /> starting but if the string has the following then I wanna parse it out myString = <br /> some text goes here <b> Some other things </b>: just more test <b> http://website/index.php </b> on...

List(of String) in structure in vb.net

How would I make use of a List(of String) in a structure in vb.net. for example Structure examplestrut Public exampleslist As List(Of String) End Structure How would I call exampleslist.add("example 1")? ...

What to use for Python string.find?

The documentation for Python 2.7 lists string.find as a deprecated function but does not (unlike atoi and atol) provide an alternative. I'm coding in 2.7 at the moment so I'm happy to use it but I would like to know: what is it going to be replaced with? is that usable in 2.7 (if so, I'll use it now so as to avoid recoding later)? ...

What is the underlying container in a Java String?

Is it just a char array? ...

How to know that a string starts/ends with a specific string in jQuery ?

I want to know if a string starts with the specified character/string or ends with it in jQuery. For Example: var str = 'Hello World'; if( str starts with 'Hello' ) { alert('true'); } else { alert('false'); } if( str ends with 'World' ) { alert('true'); } else { alert('false'); } If there is not any function then any al...

php mysql query display one instance of a value in field

I have this query that searches my database for accommodation that has a type that is equal to e.g. "Hotel" it then outputs the results in an list displaying the location of the hotels. Basically because there are lets say 4 hotels in Windermere, Windermere is coming up 4 times. Is there anyway I can tell it to only display one instance ...

PHP echo does not work.

I am trying to print a variable between curly braces as Product_number{product_version} I tried echo "$product_number{$product_version}"; But that does not work. I don't understand why :( ...

why is my std::string being cut off?

I initialize a string as follows: std::string myString = "'The quick brown fox jumps over the lazy dog' is an English-language pangram (a phrase that contains all of the letters of the alphabet)"; and the myString ends up being cut off like this: 'The quick brown fox jumps over the lazy dog' is an English-language pangram (a p...

How do I delete "filename.txt" in "blah\bleurgh\filename.txt" in VBS?

Hi, such a silly question I know, but I want to remove the filename in a string such as "blah\bleurgh\filename.txt" To delete the extension I would do strFile = Left(strFile, InStrRev(strFile, ".") - 1) But doing similiar to delete the filename at the end does nothing, e.g. tempStrFile = Left(tempStrFile, InStrRev(tempStrFile, "\...

Special chars in single and double quoted strings

Hey! I fetch a field from a database that contains a rtf document. For Example this could look like this: {\rtf1\ansi\ansicpg1252\deff0\deflang1031{\fonttbl{\f0\fnil\fcharset0 Calibri;}} {*\generator Msftedit 5.41.21.2509;}\viewkind4\uc1\pard\sa200\sl276\slmult1\lang7\f0\fs22 asdfasdf\par a\par sf\par asd\par fasd\par \b dfas\b0\par ...

PHP: Splitting long query string across multiple lines

Hi, I've got a long string which I want to split accross multiple lines so it's easier to read. but I'm not sure what the syntax is $xml = array('sXML' =>"<queryxml><entity>Ticket</entity><query><field>Status<expression op=\"$condition1\">$complete</expression></field><condition operator=\"AND\"><field>AccountID<expression op=\"equals\...

compare char* with string macro

Hi I have the following code: #define INPUT_FILE "-i" int main(int argc, char* argv[]) { .... } is there any way in C++ to compare between strings in argv[] and INPUT_FILE? I tried strcmp(argv[1],INPUT_FILE) It compiles but return false each time. Thanks ! ...

Using very long (10000+ characters) strings as SqlParameter value

Hi, all, I am trying to execute an insert command into the database and one of the columns is of type nvarchar(MAX). Insert command is created by using .NET SqlCommand class and each of the parameters is represented by one SqlParameter object. My command gets executed always, but when I pass string which length is large (10000+ charac...

boost::interprocess::string conversion to char*

Is it possible to convert a boost::interprocess::string to an std::string or to a const char*? Something like c_str()... E.g.: boost::interprocess::string is = "Hello world"; const char* ps = is.c_str(); // something similar printf("%s", ps); I could even get a copy of the string in a non-shared memory block. E.g.: boost::interp...