string

Web service in iphone

i have a webservice and implementing that ,but when i get the array from this weservice its showing characters like this line brake in some keys. I am trying to replace that with stringbyreplacing occurance of string but nothing happens. Could anyone help me for this to replace this type of characters,show that when u want to sho...

Split a string with php

I have a string called $gallery, $gallery is a list of image URLS The image urls are seperated by a semi- colon ;. Example http://www.website.com/image1.jpg;http://www.website.com/image2.jpg;http://www.website.com/image3.jpg How can I split this up and place each url in an image tag, I suppose using preg_split? Thanks ...

Best way to parse a file in Objective-c

Hello everyone. I am trying to parse out an apache-like config file using Objective-c. Where is the best place to start? I haven't done a lot of file read/write on this platform. Thanks! ...

How do I convert XML to string and get the element value?

How do I convert XML to string and get the element value? Example XML <Example> <Option1>x</Option1> <Option2>y</Option2> <Option3>z</Option3> </Example> . If i wanted to get option1 it would return x, option2 returns y, option3 returns z. etc.... ...

Parsing big string (HTML code)

Hello! I'm looking to parse some information on my application. Let's say we have somewhere in that string: <tr class="tablelist_bg1"> <td>Beja</td> <td class="text_center">---</td> <td class="text_center">19.1</td> <td class="text_center">10.8</td> <td class="text_center">NW</td> <td class="text_center">50.9</td> <td class="text...

C Homework; 1st Pointer Assignment

This code is supposed to skip white space and return one word at a time. A couple of questions on this code: When the code gets to the *word++=c; line I get a core dump. Have I written this line correctly? and is return correct. And Do I need to somehow allocate memory to store the word? //get_word int get_word(char *word,int lim){ ...

php syntax..giving error

$sql='UPDATE Reg_Stud SET Result=$perc WHERE RegID="$_SESSION['id']"'; Whts wrong with this syntax ...

String Tokenization/Regex Stack/Queue Problem - "ABC [YXYZ] [123] SomeText More Text [Split]"

how can i split them into an array of items, i.e. array[0] = "ABC ", array[1] = "YXYZ", array[2] = " " array[3]= " 123 " ... Regular Expression Gurus! Help! Don't care about performance, only code terseness, i.e. nifty unreadable code is totally fine. EXTRA CREDIT: I really want to do this --> everything in [ ] needs to basically for...

C# Replacing matching substrings in a string

Hi. How do I remove all matching substrings in a string? For example if I have 20 40 30 30 30 30, then I just 20 40 30 (and not the other 30s). Do I use a regex? If so, how? ...

Scala: divide strings

Hi folks, The title sounds a bit crazy but having the * function for java.lang.String in Scala ("a" * 3 = "aaa"), why don't we have a / function so that "aaa" / "a" = 3 ? Cheers Parsa ...

Regex how to match an optional character

I have a regex that I thought was working correctly until now. I need to match on an optional character. It may be there or it may not. Here are two strings. The top string is matched while the lower is not. The absence of a single letter in the lower string is what is making it fail. I'd like to get the single letter after the startin...

Randomness vs Uniqueness ?

In a web application if a user check the Remember Me box I'm gonna create a cookie and save it in database and assign it to user (long-life cookie). On any page request (page_load) I check this cookie (if session is null) and ask DAL for user object. If I use GUID it would be unique but the question is if a user can guess the pattern may...

How to compute de Bruijn sequences for non-power-of-two-sized alphabets?

I'm trying to compute de Bruijn sequences for alphabets which have a number of characters which is not a power of two. For alphabets with a 2^k characters, calculating de Bruijn sequences is easy: There are several simple rules, such as "Prefer Ones" and "Prefer Opposites" which work for generating B(2,n). B(2^k,n) is exactly the same a...

Read multiline text with values separated by whitespaces

I have a following test file : Jon Smith 1980-01-01 Matt Walker 1990-05-12 What is the best way to parse through each line of this file, creating object with (name, surname, birthdate) ? Of course this is just a sample, the real file has many records. ...

drawing a string with a transparent background using C# ?

The standard way of g.DrawString creates a gray background. So if overlay another string on the form, part of it appears gray. My question is, is there any way to draw a string with a transparent background? i want to be able to overlay strings, but still be able to see them. ...

Copying alhpanumeric chars in C

Hey, this should be pretty simple but getting stuck. Have a char array of text, want to store the alphanumeric lowercase value in a pointer array. ie mystr should point to a char[] of "50sometexthere" char[] myline = " 50 Some Text Here "; char *mystr = (char *)malloc(128 * sizeof(char)); char *tmp = myline; while (*tmp != '\0'){ i...

Python - Most efficient way to compare # of words sequenced in "right" order across two strings/lists

Hi experts, I was wondering what the most computationally efficient Python way of cracking this problem would be. Say you have two strings (or lists from splitting those strings--doesn't matter), "this is the right string" vs. "this is right the string." We're assuming that the first string is always right, and a score will be assigne...

problem with awk print

Hi guys I want to print in awk line and character ' after the line, but awk put the character in the middle of the line. Here is my code : awk -v d="'" {print $0 d} i am using bash2 thanks for help ...

Replacing string in textfile with quotes and doublequotes with sed

Hello, Lets say I want to replace the following string within a textfile: document.write(unescape("%3Cscript src='" + \ + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); I came up with this sed command, but surprisingly nothing happens at all. sed -i "s/document.write(unescape(\"%3Cscript src=\"\' + \\ + \"go...

Add character a place in String

Hi I'm trying to make a method that shall help me to spell world right. After addChar have return its work based on the input "famili", I want the result array to contain the word "familiy". Now the method removes a character from the string and replace it with the current char in alpha[], can someone please give me some help to make th...