string

PHP / regular expression to check if a string contains a word of a certain length

I need to check whether a received string contains any words that are more than 20 characters in length. For example the input string : hi there asssssssssssssssssssskkkkkkkk how are you doing ? would return true. could somebody please help me out with a regexp to check for this. i'm using php. thanks in advance. ...

Problem comparing strings in Delphi 2010

I'm slightly confused and hoping for enlightenment. I'm using Delphi 2010 for this project and I'm trying to compare 2 strings. Using the code below fails if AnsiStrIComp(PAnsiChar(sCatName), PAnsiChar(CatNode.CatName)) = 0 then... because according to the debugger only the first character of each string is being compared. I.E. if s...

How to get numbers out of string?

Hello I'm using a Java StreamTokenizer to extract the various words and numbers of a String but have run into a problem where numbers which include commas are concerned, e.g. 10,567 is being read as 10.0 and ,567. I also need to remove all non-numeric characters from numbers where they might occur, e.g. $678.00 should be 678.00 or -87 ...

binding gridviewcolumn to string array

Hello Experts, having issues binding a gridviewcolumn to a string array (that probably sounds mad, but I can't seem to do this in the usual manner as I need to concatenate some xml results into one column cell). When I do the binding it simply hooks into the first string and ignores whatever else is generated into my array. The bit that ...

Trade off between reading from database and memory storage of Java strings using servlets

Hello I'm in the process of setting up a system which will have to repeatedly parse large amounts of text (as a String or StringBuffer - which might be better?) acquired from the a data source. The text will be displayed and may consist of several thousand words and each time the text is parsed, each word may have to checked against a l...

How to %-sign in php string

Hi i need to remove % sign from file or image name in directory which string i use $oldfile = "../wallpapers/temp-uploaded/".$file ; $newfile = "../wallpapers/temp-uploaded/". trim( str_replace('%', '', $file)); rename("$oldfile","$newfile"); But its not work reply me which string i use ( trim, str_replace not work preg_replace ho...

C - read string from buffer of certain size

Hey, I have a char buf[x], int s and void* data. I want to write a string of size s into data from buf. How do I do that? Thanks in advance. ...

Extracting date from a string in Python

How can I extract the date from a string like "monkey 2010-07-10 love banana"? Thanks! ...

is there a tool that can extract all strings from any type of file?

i'm looking for an alternative to wyd 0.2 that can extract strings from any type of file it comes across. thanks =) ...

IronRuby download file using the WebClient "Not enough storage is available to process this command"

Entering the following two lines into an interactive window in IronRuby interactive console. wc = System::Net::WebClient.new doc = wc.DownloadString("http://yahoo.com") I get the following error. => mscorlib:0:in `WinIOError': Not enough storage is available to process this command.\r\n (IOError) from mscorlib:0:in `Write' fr...

Python: read file line by line into array

How do I read every line of a file in Python and store each line as an element in an array? I want to read the file line by line and each line is appended to the end of the array. I could not find how to do this anywhere and I couldn't find how to create an array of strings in Python. ...

Converting form CharField type to string in Django

Hi, I have created a form class which is used to generate a formset. I can easily generate the formset with initial data in it. However, I need to write the value of one of my CharField elements in my form as the label for another field. In order to do get this dynamic name, I wrote {{ form.field }} as the value for label. But since fie...

Delphi: Access violation when putting a string in an editbox?

Well, I am studing some inline assembly in Delphi and the assembly crypto routine is all going great, until I try to parse the ShortString into the Textbox. The violation I get is as follows: The full code is here: procedure TForm2.Button1Click(Sender: TObject); var len,keylen:integer; name, key:ShortString; begin name := ShortSt...

Select a specific character in a string and offset it (visually) with Jquery

Hi I'm trying to use Jquery/Javascript to mimic a broken typewriter font (since I could not find one). But I want to make it random which letter gets broken. I was able to split the string of the id that I wanted and use a bit of code I found to get a random number between 0 and the total length of the string. What I'm having proble...

CAnnot convert type string[] to string when value is assigned with number in []

Why does it complain about it not being able to convert a string array to a string when the values are strings within a string array Code: int i; string[] Filenames; OpenFileDialog UnConvertedFilesList = new OpenFileDialog(); if (UnConvertedFilesList.ShowDialog() == DialogResult.OK) { ...

jQuery - string disapearing from a variable

Hey, I'm doing a search box and when I want the page to redirect, something strange heppens. Here is the script: $('#search_form').submit(function(ev) { var searchTerm = $("input[name = search_term]").val(); var search_location = conf_fullSiteAddress + "search/" + searchTerm + "/"; alert(search_location); window.locatio...

elisp regexp search in strings, not buffers

I have been searching everywhere in the emacs lisp documentation for how to regular expressions search into a string. All I find is how to do this in buffers. Is there something I'm missing? Should I just spit my string into a temporary buffer and search for it there? Is this just the coding style of elisp, something I'll get used to?...

Remove multi-line strings from a text file using a batch script

I am trying to create a batch file that will edit a text file to remove lines that contain a certain string and remove the line directly after that. An example of this file would look like this: LINE ENTRY KEEP_1 BLA BLA END LINE ENTRY REMOVE_1 FOO BAR END LINE ENTRY REMOVE_2 HELLO WORLD END LINE ENTRY KEEP_2 CAT DOG END After runnin...

why is this syntax exclusively used to initialize string literals and can't be used for an array of characters?

Possible Duplicate: initializing char arrays in a way similar to initializing string literals below is a sample of initializing a string literal in which a terminating null character is added at the end of string, necessarily: char reshte[]="sample string"; I wonder why can't we initialize an array of characters without ter...

fast auto-guessing of date strings

For a huge number of huge csv files (100M lines+) from different sources I need a fast snippet or library to auto-guess the date format and convert it to broken-down time or unix time-stamp. Once successfully guessed the snippet must be able to check subsequent occurrences of the date field for validity because it is likely that the dat...