Hi there:
I wish to known if exist a clean way to split a string using different tags for opening and ending.
For example:
<&field1&>outside<&field2&>
using the function split:
string[] dd={"<&","&>"};
string[] b1 = a1.Split(dd,StringSplitOptions.None);
it show me:
0:
1:field1
2:outside
3:field2
4:
(that ...
Does the POSIX standard or another C standard provide a way to recover a meaningful message from a signal number, in the same way that strerror() makes it possible to recover a message from errno? The Gnu C library has strsignal(), but if possible, I would like something portable to BSD and other Unix variants.
...
In the Pragmatic Core Data book, I came across this code snippet for an NSString setter:
- (void)setMyString:(NSString*)string;
{
@synchronized(self) {
if ([string isEqualToString:myString]) return;
[myString release];
myString = [string retain];
}
}
Is there any reason to use [string isEqualToString:myString] instead of...
I have huge list (200000) of strings (multi word). I want to group these strings based on comman array of word match among these strings. I cant think of a low computation time algorithm for this
"AB 500"
"Bus AB 500"
"News CA"
"News CA BLAH"
My plan was
a. Tokenize them to words.
b. Create a global array tokens
c. Compare those...
Hi all, I need to determine whether the ToString() method of an object will return a meaningful string instead of its class name. For example, bool, int, float, Enum, etc. returns meaningful string, instead an instance of ArrayList will return "System.Collections.ArrayList". If there a simple way to archive that?
Thanks in advance.
Reg...
Hi,
Is there any way I can easily check if a string conforms to the SortableDateTimePattern ("s"), or do I need to write a regular expression?
I've got a form where users can input a copyright date (as a string), and these are the allowed formats:
Year: YYYY (eg 1997)
Year and month: YYYY-MM (eg 1997-07)
Complete date: YYYY-MM-DD (e...
How could i convert a Greek string, to Unicode with VB.NET, without knowing the source encoding?
...
How can I extract a substring which is composed of the rightmost six letters from another string?
Ex: my string is "PER 343573". Now I want to extract only "343573".
How can I do this?
...
I've got a textbox in my XAML file:
<TextBox
VerticalScrollBarVisibility="Visible"
AcceptsReturn="True"
Width="400"
Height="100"
Margin="0 0 0 10"
Text="{Binding ItemTypeDefinitionScript}"
HorizontalAlignment="Left"/>
with which I get a st...
I am working in C++ with two large pieces of code, one done in "C style" and one in "C++ style".
The C-type code has functions that return const char* and the C++ code has in numerous places things like
const char* somecstylefunction();
...
std::string imacppstring = somecstylefunction();
where it is constructing the string from a c...
I just noticed that there is no prototype property on strings in JavaScript.
This is a pedagogical question while I try to wrap my head around the JavaScript type system but what gives?
How come "abc".toString() works? And how would I go about extending strings? If I wanted to be able to do "hey you!".alertDialog() for example?
...
Hey guys this is a followup to my previous question. I now have a text file which is formatted like this:
100 200
123
124 123 145
What I want to do is get these values into a two dimensional ragged array in Java.
What I have so far is this:
public String[][] readFile(String fileName) throws FileNotFoundException, IOException {
...
Hi,
I have a program that is manually generating a pdf using PDFSharp in C#. Although it is rather tedious I have to use it and am nearing completion of the task. Only one issue remains
Problem: I am wondering how I can find out what the width of a given char is for a given font size in Arial
I am having trouble coming up with a more ...
I have a C string that looks like "Nmy stringP", where N and P can be any character. How can I edit it into "my string" in C?
...
What is the easiest and most efficient way to remove spaces from a string in C?
Thanks.
...
Note: This question was influenced by this answer.
The following is valid C code:
char myString[] = "This is my string";
This will allocate a string of length 18 (including the \0 character) on the stack and assign the specified value to it.
However, the following:
char myStrings[][] = {"My 1st string", "My 2nd string", "My 3rd str...
I'm receiving a date field from a php file, and I need to format it.
I get this string: "2009-11-12 17:58:13"
I want to convert to "November 12, 2009 5:58:13 pm"
I tried to work with the Date class, but I get stuff like this:
Type Coercion failed: cannot convert "2009-11-12 17:58:13" to Date.
Anyone know of any good utilities for doin...
I am trying to write a method that uses recursion to compare the strings str1 and str2 and determine which of them comes first alphabetically (i.e., according to the ordering used for words in a dictionary).
If str1 comes first alphabetically, the method should return the integer 1.
If str2 comes first alphabetically, the method shoul...
I currently use string literals in my xpath expressions. For example:
paragraphList = root.SelectNodes("paragraph");
I know you should generally avoid using literal values, but I figure this is safe, since the names of your xml nodes will rarely change. Is this bad practice, or am I same?
...
I'm trying to write a method that uses recursion to print the string formed by "interleaving" the strings str1 and str2. In other words, it should alternate characters from the two strings: the first character from str1, followed by the first character from str2, followed by the second character from str1, followed by the second charact...