This seems like it should be really simple, but for some reason, I'm not getting it to work. I have a string called seq, which looks like this:
ala
ile
val
I want to take the first 3 characters and copy them into a different string. I use the command:
memcpy(fileName, seq, 3 * sizeof(char));
That should make fileName = "ala", right...
Hi,
While working for one of my tasks I have encountered this Problem.
Problem:
I have an XML file which contains an like this
<?xml-stylesheet type="text/xsl" href="OldStyle.xsl"?>
and I want to remove this tag and Replace it with a new like this:
<?xml-stylesheet type="text/xsl" href="NewStyle.xsl"?>
The replacement should be ...
Hi all
I have a String that contains a line of html code eg. '<b>1995</b>'. Let's say this String could also contain '<b>1997</b>' or '<b>1999</b>' etc. I want to use a replace method to remove the tags but leave the years. Is there a way to implement a wildcard character to do this, something like:
first_string = "First year is <b>199...
I am writing a StringOutputStream class in Java because I need the pre-Base64-encoded data from an OutputStream to go to a String. I need this as a String because I am going to be putting it into a W3C XML Document.
Everything would be fine, but I'm dealing with (relatively) large objects. The resulting object turns out to be about 25 M...
Currently I have varchar field. The delimiter is "$P$P$".
The delimiter will appear at least once and at most twice in the varchar data.
Eg.
Sample Heading$P$P$Sample description$P$P$Sample conclusion
Sample Heading$P$P$Sample Description
If the delimiter appears twice, I need to insert a text before the second occurance of the de...
I'd like to break apart a String by a certain length variable.
It needs to bounds check so as not explode when the last section of string is not as long as or longer than the length. Looking for the most succinct (yet understandable) version.
Example:
string x = "AAABBBCC";
string[] arr = x.SplitByLength(3);
// arr[0] -> "AAA";
// ...
Consider the following String :
5|12345|value1|value2|value3|value4+5|777|value1|value2|value3|value4?5|777|value1|value2|value3|value4+
Here is how I want to split string, split it with + so I get this result :
myArray[0] = "5|12345|value1|value2|value3|value4";
myArray[1] = "5|777|value1|value2|value3|value4?5|777|value1|value2|va...
I am writing an app and am having problems returning a simple string value, and I'm not sure why.
The function I am using (within a file called APIManager.m) is:
- (NSString*) returnVenueUrl {
NSString *venueUrl = [devEnvironment stringByAppendingString:@"venue/id/"];
return venueUrl;
}
I can return this properly by doing this in an...
First, the background: I'm writing a Ruby app that uses SendGrid to send mass emails. SendGrid uses a custom email header (in JSON format) to set recipients, values to substitute, etc. SendGrid's documentation recommends splitting up the header so that the lines are shorter than 1,000 bytes.
My question, then, is this: given a long JS...
Hi, I'm looking for a way to limit a string in php and add on ... at the end if the string was too long.
Thanks :)
...
Hi,
I am looking for a regular expression for matching that contains no white space in between text but it may or may not have white space at start or end of text.
...
Hello struggling here guys..
Is it possible to string replace anything between the the first forward slashes with "" but keep the rest?
e.g. var would be
string "/anything-here-this-needs-to-be-replaced123/but-keep-this";
would end up like this
string "/but-keep-this";
Hope that made sence
...
For instance
String s = "Hello" + " World";
I know there are two strings in the pool "Hello" and "World" but, does: "Hello World" go into the string pool?
If so, what about?
String s2 = new String("Hola") + new String(" Mundo");
How many strings are there in the pool in each case?
...
I have a string that I would like represented uniquely as an integer.
For example: A3FJEI = 34950140
How would I go about writing a EncodeAsInteger(string) method. I understand that the amount of characters in the string will make the integer increase greatly, forcing the value to become a long, not an int.
Since I need the value to ...
Starting with a string of an unspecified length, I need to make it exactly 43 characters long (front-padded with zeroes). It is going to contain IP addresses and port numbers. Something like:
### BEFORE
# Unfortunately includes ':' colon
66.35.205.123.80-137.30.123.78.52172:
### AFTER
# Colon removed.
# Digits padded to three (3) and fi...
Hi,
Is there any inbuilt way in C# to split a text into an array of words and delimiters?
What I want is:
text = "word1 + word2 - word3";
string[] words = text.Split(new char[] { '+', '-'});
//Need list '+', '-' here?
Any ideas? Obviously I can just process the text by hand... :)
...
DEAR All
I'm new to the C++, so maybe someone can say what the proper way to write a function that gets a string char (represents number) and converts it to the integer number.
For example : input : Sixty five, output: 65.
Maybe it should use by cin.getline() ?
Well, vice-versa is little bit simlper...
Thanks for advance.
Igal
...
I have this method that receives an ID number and downloads an HTML website according to that ID.
Typically, an IMDB link is like this:
http://www.imdb.com/title/tt0892791/
http://www.imdb.com/title/tt1226229/
http://www.imdb.com/title/tt0000429/
They all follow the 'tt' then 7 digits, with lack of digits turning into zeroes to fill ...
In the thread What’s your favorite “programmer ignorance” pet peeve?, the following answer appears, with a large amount of upvotes:
Programmers who build XML using string concatenation.
My question is, why is building XML via string concatenation (such as a StringBuilder in C#) bad?
I've done this several times in the past, as it's so...
Hello,
I am trying to set up a list of file names for a parameter to SHFileOperation. I want to be able to concatenate a file name onto the char array, but i dont want to get rid of the terminating character. for example, I want this:
C:\...\0E:\...\0F:\...\0\0
when i use strcat(), it overwrites the null, so it looks like
C:\...E:\......