string

How to know if a string contains accents

How to know if a string contains accents? ...

im counting the number of characters in a file but i want to count the number of words that are less than 5 and 6 or greater.

i want to do this: reads the words in the file one at a time. (Use a string to do this) Counts three things: how many single-character words are in the file, how many short (2 to 5 characters) words are in the file, and how many long (6 or more characters) words are in the file. HELP HERE im not sure on how about reading file into a st...

How do I truncate a .NET string?

I apologize for such a question that likely has a trivial solution, but strangely, I could not find a concise API for this problem. Essentially, I would like to truncate a string such that its length is not longer than a given value. I am writing to a database table and want to ensure that the values I write meet the constraint of the ...

Recursive String Function (Java)

Hi, I am trying to design a function that essentially does as follows: String s = "BLAH"; store the following to an array: blah lah bah blh bla bl ba bh ah al So basically what I did there was subtract each letter from it one at a time. Then subtract a combination of two letters at a time, until there's 2 characters remaining. Store ...

jquery , selector, contains one of the text

Hi , I need a help for one thing : this is my jQuery idea: var text = "Some Text1, Some Text2, Some Text3"; $("h3:contains('"+even one of this string+"')").each(function() { $(this).append("<span>Some Text</span>"); }); This is My HTML <h3 class="test1">Some Text2</h3> ...

sql - datetime variable versus string representation of datetime variable

I have a query that takes too long to respond when the search parameter happens to be a varchar datatype with date. However, if i convert varchar to datetime variable, the query runs fine. For ex: This takes too long. select count(id) from names where updateddate > '1/5/2010' This runs fine. declare @dateparam datetime set @...

Java string too long?

I have the following code in Java (which worked just fine in C++ for some reason) which produces an error: int a; System.out.println("String length: " + input.length()); for(a = 0; ((a + 1) * 97) < input.length(); a++) { System.out.print("Substring at " + a + ": "); System.out.println(input.substring(a * 97, 97)); //other co...

C#: why does the string type have a .ToString() method

C#: Why does the string data type have a .ToString() method? ...

C#: how to construct strings

Which of these will achieve the correct result: (1) int X = 23; string str = "HELLO" + X.ToString() + "WORLD"; (2) int X = 23; string str = "HELLO" + X + "WORLD"; (3) int X = 23; string str = "HELLO" + (string)X + "WORLD"; EDIT: The 'correct' result is for str to evaluate to: HELLO23WORLD ...

lua split into words

I have a string in lua. It's a bunch of [a-zA-Z0-9]+ separated by a number (1 or more) spaces. How do I take the string and split it into a table of strings? Thanks! ...

How to convert a "dd/mm/yyyy" string to datetime in SQL Server?

I tried this SELECT convert(datetime, '23/07/2009', 111) but got this error The conversion of a varchar data type to a datetime data type resulted in an out-of-range value. However SELECT convert(datetime, '07/23/2009', 111) is OK though How to fix the 1st one ? ...

Removing unwanted characters from a string in Python

Hi, I have some strings that I want to delete some unwanted characters from them. For example: Adam'sApple ----> AdamsApple.(case insensitive) Can someone help me, I need the fastest way to do it, cause I have a couple of millions of records that have to be polished. Thanks ...

convert image to base64 string using java

i want to know how to convert image to base64 string in java. thanks and advance.. ...

[C] Signed Hexadecimal string to long int function

I need a function to convert a 32bit or 24bit signed (in two's complement) hexadecimal string into a long int. Needs to work on both 32bit and 64bit machines (regardless of the size of long int) and work regardless of whether the machine is a two's complement machine or not. SOLUTION: long int hex2li (char hexStr[], int signedHex) { ...

string manipulation without alloc mem in c

I'm wondering if there is another way of getting a sub string without allocating memory. To be more specific, I have a string as: const char *str = "9|0\" 940 Hello"; Currently I'm getting the 940, which is the sub-string I want as, char *a = strstr(str,"9|0\" "); char *b = substr(a+5, 0, 3); // gives me the 940 Where substr is my...

C++ string sort like a human being?

I would like to sort alphanumeric strings the way a human being would sort them. I.e., "A2" comes before "A10", and "a" certainly comes before "Z"! Is there any way to do with without writing a mini-parser? Ideally it would also put "A1B1" before "A1B10". I see the question "Natural (human alpha-numeric) sort in Microsoft SQL 2005" with ...

Java Optimization String vs Char Arrays

In a program I am writing I am doing a lot of string manipulation. I am trying to increase performance and am wondering if using char arrays would show a decent performance increase. Any suggestions? ...

Haskell : Type casting Int to String

I know you can convert a String to an number with read like so: Prelude> read "3" :: Int 3 Prelude> read "3" :: Double 3.0 But how do you grab the string representation of an Int value? ...

How to capitalize first letter of each sentence?

I know how to capitalize first letter in each word. But I want to know how to capitalize first letter of each sentence in C#. ...

Convert string into two dimensional string array in Java

Hi guys, I like to convert string for example : String data = "1|apple,2|ball,3|cat"; into a two dimensional array like this {{1,apple},{2,ball},{3,cat}} I have tried using the split("") method but still no solution :( Thanks.. Kai ...