string

String Usage in Java

String date = new java.text.SimpleDateFormat("MM-dd-yyyy").format(new java.util.date()); upload.uploadfile("192.168.0.210", "muruganp", "vm4snk", "/home/media/Desktop/FTP Upload/+date+"_RB.zip"", "/fileserver/filesbackup/Emac/+date+"_RB.zip""); uploadfile is a function which uploads the file 10-20-2010_RB.zip to the server location. B...

Strange string split behaviour

I'm requesting data from my server and receive a string in the form of 2|bit.ly|1||1| and | should be the seperator. I though the following piece of code should do the work BufferedReader br = null; ... br = new BufferedReader(new InputStreamReader(inputStream)); ... String line; String[] columns; ContentValues values; while((line =...

how string terminates in java?

Hi I am trying to write a recursive function which calculates the length of string in Java I know that there already exists str.length() function, but the problem statement wants to implement a recursive function In C programming language the termination character is '\0', I just want to know how to know if string ends in Java My pro...

C++: Trouble loading long string from XML file using Mini-XML

I'm using the Mini-XML library to parse and XML file. I am able to load just about every element and attribute, but I am having trouble loading a long string. Here is the relevant part of the code: //Load XML file into XmlO void load(wxString filenam){ //First, convert wxString to std::string for safety (char* is transient...

How to perform string concatenation in PL/SQL?

I have a variable defined as define dbs '&1' Suppose I pass database1 as an argument. Then the statement is interpreted as define dbs database1 I want to append single quotes around the string, ie I want it to be interpreted as define dbs 'database1' How should I do this? ...

String class based on graphemes?

I'm wondering why we don't have some string classes that represent a string of Unicode grapheme clusters instead of code points or characters. It seems to me that in most applications it would be easier for programmers to access components of a grapheme when necessary than to have to organize them from code points, which appears necessa...

how to use sscanf in loops?

Is there a good way to loop over a string with sscanf? Let's say I have a string that looks like this: char line[] = "100 185 400 11 1000"; and I'd like to print the sum. What I'd really like to write is this: int n, sum = 0; while (1 == sscanf(line, " %d", &n)) { sum += n; line += <number of bytes consumed by sscanf> } but t...

optimize search through large js string array?

if I have a large javascript string array that has over 10,000 elements, how do I quickly search through it? Right now I have a javascript string array that stores the description of a job, and I"m allowing the user to dynamic filter the returned list as they type into an input box. So say I have an string array like so: var descArr = ...

How to find nth occurrence of character in a string?

Similar to a question posted here, am looking for a solution in Java. That is, how to find the index of nth occurrence of a character/string from a string? Example: "/folder1/folder2/folder3/". In this case, if I ask for 3rd occurrence of slash (/), it appears before folder3, and I expect to return this index position. My actual inte...

Is StringUtils.isNumeric() method specification logically correct?

Apache's StringUtils.isNumeric() method specification says: Checks if the String contains only unicode digits. A decimal point is not a unicode digit and returns false. Null will return false. An empty String ("") will return true. Is this logically right? Why do they see empty string as numeric? ...

How do I convert a non-null-terminated char array into a string?

I have a function that takes in a pointer to a series of char. I wish to copy 256 chars from that point, and place them in a string. msg is not null-terminated. The below code seems to give me some problem. Is there a correct way to do this? Init( msg: PCHAR) var myStr: String; begin for i:= 1 to 256 do begin myStr[i] := msg[i-1]...

C string concatenation

I am trying to input 2 strings in C, and output a 3rd string which the concatenation of string 1 and 2. #include <stdio.h> #include <stdlib.h> #include <string.h> /* * */ int main(int argc, char** argv) { char stringarray1 [30]; char stringarray2 [30]; char stringarray3 [30]; int length; printf("Please enter s...

How can I convert a string to an int in Python?

Possible Duplicates: Python - Parse String to Float or Int How can I convert a string to an int in Python? The output I'm getting for my little example app is the following: Welcome to the Calculator! Please choose what you'd like to do: 0: Addition 1: Subtraction 2: Multiplication 3: Division 4: Quit Application 0 Enter yo...

How can I convert a string to an int in Python?

The output I'm getting for my little example app is the following: Welcome to the Calculator! Please choose what you'd like to do: 0: Addition 1: Subtraction 2: Multiplication 3: Division 4: Quit Application 0 Enter your first number: 1 Enter your second number: 1 Your result is: 11 This is because the addition() method is taking the ...

How do I create an index in PostgreSQL based on lowercase only?

How would I set up an index based on lower case only? Even though the actual field contains both upper and lower case letters. Also, can I run a query and have only the lower case index value returned? Thanks-- ...

PHP Notice: Array to string conversion

I have an ecommerce site based off of this tutorial. Now, in the cart.php page, whenever someone updates the quantity and proceeds to click the Update Cart button, they are greeted with the following notices: Notice: Array to string conversion in /home/aquadual/public_html/fiverrproject/plaincart/library/config.php on line 51 Notice: ...

Having jQuery string comparison issues...

I've got a fiddle going here to show what I'm trying to do. I have a table that is generated dynamically, so the columns could appear in whatever order the user chooses. So, I'm trying to get the index of two specific headers so that I can add a CSS class to those two columns for use later. ...

STL queue push behavior

I come across a behavior in STL queue push which I don't quite understand. Basically, I have two struct structA{ string a; } structB{ char b[256]; } structA st1; structB st2; ...assign a 256 characters string to both st1 and st2... queue<structA> q1; queue<structB> q2; for(int i=0 ; i< 10000; i++){ q1.push(st1); } for(int i...

Hash string in c#

Hello there, I have problem when trying get hash string in c#. I already try research in few website, but most them using file to get hash. Even some there , for string, there bit complex. And other one I found it for window authentication for web like this: FormsAuthentication.HashPasswordForStoringInConfigFile(tbxPassword.Text.Trim(...

How do I convert the string "39.9983%" into "39%" in C#?

I don't want to do any rounding, straight up, "39%". So "9.99%" should become "9%". ...