string

LINQ: concatenate multiple int properties into a string

I have an object with two different integer properties in it, and I'm trying to get a a new object in Linq to Entities, combining two integer properties from the same object as concatenated strings, as follows List<DateRange> collection = (from d in context.dates select new DateRange { DateString = from s in context.Seasons wher...

SQL select row into a string variable without knowing columns

Hello, I am new to writing SQL and would greatly appreciate help on this problem. :) I am trying to select an entire row into a string, preferably separated by a space or a comma. I would like to accomplish this in a generic way, without having to know specifics about the columns in the tables. What I would love to do is this: DECLAR...

How do I view .NET interned strings

In CLR 2.0, is there any way to view all of the strings that have been interned? I've looked into the CLR Profiler APIs and can't see any API calls to monitor when a string gets interned. Also, what is the scope of interned strings? Do interned strings get collected when the App Domain gets unloaded, or do they span App Domains? ...

How to use jQuery to extract a URL parameter from a string

i hat one task, and know i have to continue but have a bad experience with regexp ... :( can somebody help me : i need to take a sting from "domain url" with jquery : This is the address name : http://mydomain/Our-Company/default.aspx?txt=James D. Perrlo I want to take with jquery la string after "?txt=" in this case "James D. Pe...

Array of strings in C

I'm trying to create a structure storing strings and I'm getting an error incompatible types when I try and insert as string into the array. This my first time working with a program in C. Could somebody help spot my problem. This is my implementation of list.c struct list *init_list(int num) { struct list *p; p = malloc(LIS...

Java String.replaceFirst() that takes a "starting from" argument

I need to replace a word in a string looking like "duh duh something else duh". I only need to replace the second "duh", but the first and the last ones need to stay untouched, so replace() and replaceFirst() don't work. Is there a method like replaceFirst(String regex, String replacement, int offset) that would replace the first occurre...

Dealing with BACKSLASH character in non-string literals in Python.

I have the following string read from an XML elememnt, and it is assigned to a variable called filename. I don't know how to make this any clearer as saying filename = the following string, without leading someone to think that I have a string literal then. \\server\data\uploads\0224.1307.Varallo.mov when I try and pass this to os.p...

Getting fast translation of string data transmitted via a socket into objects in Python

I currently have a Python application where newline-terminated ASCII strings are being transmitted to me via a TCP/IP socket. I have a high data rate of these strings and I need to parse them as quickly as possible. Currently, the strings are being transmitted as CSV and if the data rate is high enough, my Python application starts to ...

Convert string "dd month_full_name year" to string "yyyy/mm/dd" with .NET

Is there anything standard in C# to transform in to out. I don't mind ad hoc routine either. string in = "1 February 2001" string out = "2001/02/01" ...

Convert a string to a GregorianCalendar

How do a I take an input birthday string such as 02 26 1991 and make it into a Gregorian Calendar? I tried parsing it first but it keeps giving me an error message so I'm not quite sure what I'm doing wrong. I also have other input data before this date. One is another string and one is a double value. ...

Passing strings to C functions with SAS proc proto

I've been poking my nose in extending SAS string handling with some C functions such as a longest common substring algorithm. The proc FCMP functions get easily pretty inefficient. The embedded C compiler in proc proto doesn't seem to produce the results I expect after writing the algorithm in Visual Studio. One thing I think I have ver...

Encoding strings into HTML in Java

I need to encode a Java String to display properly as part of an HTML document, e.g. all new lines or tab characters. So I have e.g. "one\ntwo", and I want to get something like "one<br>two". Do you know any library that would do it for me? ...

When (deep) Cloning, use String.Copy or str1 = str2?

When (deep) Cloning a custom object, should I use clone.str1 = String.Copy(obj.str1) or clone.str1 = obj.str1? I'd prefer the latter - shorter and quicker, but is it "safe"? I'd point to this thread, but, however, not sure what to use. ...

Arbitrary-sized string arrays in C#

I want to define an array of strings but I don't know the number of strings I'll need to store in it. Can I define such an array, and how can I insert strings into it? ...

C++: what benefits do string streams offer?

could any one tell me about some practical examples on using string streams in c++, i.e. inputing and outputing to a string stream using stream insertion and stream extraction operators? ...

Remove & character from string objective c

Hey, How would I go about removing the "&" symbol from a string. It's making my xml parser fail. I have tried [currentParsedCharacterData setString: [currentParsedCharacterData stringByReplacingOccurrencesOfString:@"&" withString:@"and"]]; But it seems to have no effect ...

string to json and check json key -value

{"loggedin":0,"error_message":"login_failed","success_message":"","username":"","sessionId":""} this my json in string format, i have to check in javascript that loggedin value 0 or 1 ...

what's the max characters generated by a base 10 to 36 conversion of a crc32 value

what's the maximum number of characters generated by the following statement? i need to format the output properly. echo base_convert(sprintf('%u',crc32($_string)),10,36); ...

Convert dbus.String to normal string

I am using dbus to get the current playing song from Songbird Media Player & Metadata is also taken from dbus object. The line where error comes is:- audio_file = MP3(current_playing_track['location'], ID3=ID3) The error is:- Traceback (most recent call last): File "./last.py", line 42, in <module> audio_file = MP3(current_pl...

vb.net address parsing question

i need to parse normail mailing addresses in vb.net. the requirement is address shall be split in 2 variables. so if address is 12300 euclid st. then it will be "12300" and "euclid st." in two different variables. also if address is 123 B4 euclid st then "123 B4" and "euclid st". Sometimes address is 12008 B2 euclid st Apt 12. In this c...