string

.NET string replace russian to english

I have a strange problem replacing chars in string... I read a .txt file containing russian text, and starting from a list of letters russian to english (ru=en), I loop the list and I WOULD like to replace russian characters with english characters. The problem is: I can see in the debug the right reading of the russian and the right r...

How to trim all columns in all rows in all tables of type string?

Hi folks, In Oracle 10g, is there a way to do the following in PL/SQL? for each table in database for each row in table for each column in row if column is of type 'varchar2' column = trim(column) Thanks! ...

What order of time does the .NET System.String.Length property take?

I had someone advise me to avoid repeatedly calling String.Length, because it was recalculated each time I called it. I had assumed that String.Length ran in O(1) time. Is String.Length more complex than that? ...

increasing string size through loop

what's a simple way to increase the length of a string to an arbitrary integer x? like 'a' goes to 'z' and then goes to 'aa' to 'zz' to 'aaa', etc. ...

How can I get the contents of a file at build time into my C++ string?

I have a file I am compiling in C++ in which I wish to have a string whose value is the contents of a file at the time of compilation. In other words, I'd like to #include the file but have that be inside double quotes. How can I do this in C++? Now what if that file contains double quotes as part of its text, how do I get those escap...

How do I convert a double into a string in C++(without scientific notation)?

How to convert a double into a floating-point string representation without scientific notation in C++. "Small" samples (effective numbers may be of any size, such as 1.5E200 or 1e-200) : 0.0000000000000000000000000000000000000000000000000000000023897356978234562 Thank you. ...

Using strncat with char array element in C

Hi.. I have get error with the following code and i can't figure it out. char name[]="tolgahan" char result[100]=""; strncat(result,name[1],1); I guess, i need to convert name[1] to string format but i don't now how can i do that. Please help me. Best regards. ...

C++ conversion from string to object identifier

I'm writing a program in C++ that reads in some data from an external file in order to set the values of static variables. Is it possible to convert a string to an object identifier? (e.g. convert the string "CheckBox::Unchecked" into an identifier for the object CheckBox::unchecked) ...

taking input then containing in string

input as; (A%v),(c+e),-p#-d //include no white space i want to hold input as A[0]=A%v A[1]=c+e A[2]=-p#-d is it possible? how?` ...

how to add new elements to a String[] array?

I have a Java code defined as: String[] where; /**/where.append(ContactsContract.Contacts.HAS_PHONE_NUMBER+"=1"); /**/where.append(ContactsContract.Contacts.IN_VISIBLE_GROUP+"=1"); Those two appends are not working in this form, how would that work correctly? ...

Custom string class (C++)

Hey guys. I'm trying to write my own C++ String class for educational and need purposes. The first thing is that I don't know that much about operators and that's why I want to learn them. I started writing my class but when I run it it blocks the program but does not do any crash. Take a look at the following code please before reading ...

Javascript string replace with calculations

Is there a way to resolve mathematical expressions in strings in javascript? For example, suppose I want to produce the string "Tom has 2 apples, Lucy has 3 apples. Together they have 5 apples" but I want to be able to substitute in the variables. I can do this with a string replacement: string = "Tom has X apples, Lucy has Y apples. To...

fill a buffer successively

i intend to fill a char-pointer array successively in a for-loop. the content to fill in is a integer so i need to cast. but i didn't get the result i want to.. for (i=0;i<max0;i++){ sprintf(buf, "%d", content[i]); } sprintf replaces the hole buf, but i want to append. for (i=0;i<max0;i++){ buf[i]=(char) contint[i] } but th...

Ruby string compare regardless of string case

Hi I need to check for "Apple" = "Apple" TRUE "Apple" = "APPLE" TRUE "Apple" = "Apple1" FALSE in ruby I need a string comparison but for the check to not be case sensitive. thks ...

How do I check if a C++ string is an int?

When I use getline, I would input a bunch of strings or numbers, but I only want the while loop to output the "word" if it is not a number. So is there any way to check if "word" is a number or not? I know I could use atoi() for C-strings but how about for strings of the string class? int main () { stringstream ss (stringstream::in | ...

Solve equation from string to result in C

Hi, I would like to know if anyone has info or experience on how to do something which sounds simple but doesn't look like it when trying to program it. The idea is : give a string containing an equation, such as : "2*x = 10" for example (this is simple, but it could get very complex, such as sqrt(54)*35=x^2; and so on....) and the progr...

CString a = "Hello " + "World!"; Is it possible?

I'm making my own string class and I was wondering if there's any way to replace the compiler behaviour around " characters. As I said in the title I'd like to make it so that CString a = "Hello " + "World!"; would actually work and not give a compiler error telling that it can't add 2 pointers. My string class automatically converts to ...

assigning special characters such as " in java

How can I assign this string in a Java String? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; thanks ...

How can I know whether my C++ string variable is a number or not

I have a string of class string string str; how can I check if it is a number or not, str can only have 3 possible types described below like abcd or a number like 123.4 or a number with a parenthesis attach to the end it for example 456) note the parenthesis at the end of "str" is the only possible combination of number and ...

very large string in memory

Hi, I am writing a program for formatting 100s of MB String data (nearing a gig) into xml == And I am required to return it as a response to an HTTP (GET) request . I am using a StringWriter/XmlWriter to build an XML of the records in a loop and returning the using (StringWriter writer = new StringWriter()) using (writer = XmlWriter.Cr...