I have a
string word = "degree/NN";
What I want is to remove the "/NN" part of the word and take only the word "degree".
I have following conditions:
The length of the word can be different in different occasions. (can be any word therefore the length is not fixed)
But the word will contain the "/NN" part at the end always.
How c...
Any programming language. I'm interested in knowing what top 5 methods in a string class are used on data manipulations. Or what top 5 methods does one need to know to be able to handle data manipulation. I know probably all the methods together should be used, but I'm interested to see the 5 most common methods people use.
Thanks for y...
Hi, I've just started to get in to C programming and would appreciate criticism on my ReplaceString function.
It seems pretty fast (it doesn't allocate any memory other than one malloc for the result string) but it seems awfully verbose and I know it could be done better.
Example usage:
printf("New string: %s\n", ReplaceString("great",...
Hello. Maybe I'm being stupid but I can't figure out why a pointer is being changed in this function. I have included "printf" and "puts" to show the problem. The left braket pointer is changing and invalidates the pointer arithmetic I want to do for string manipulation.
Another question I have - Is it dangerous to expect char pointers ...
How do I display a literal curly brace character when using the String.Format method?
Example:
sb.AppendLine(String.Format("public {0} {1} { get; private set; }",
prop.Type, prop.Name));
I would like the output to look like this:
public Int32 MyProperty { get; private set; }
...
Hi,
I have this code:
$array[] = "<b> FLYDANNA® HEADWRAP </b> <ul> <li type=\"circle\"><i> Sensational headwrap made from 6 pieces of fabric to fit the contours of your head perfectly </i> <li type=\"circle\"><i> Strong yet lightweight cotton wrap can be folded up and stored almost anywhere-;pocket, purse, backpack ... y...
I have been using jQuery address plugin and it passes an event.value which might result in /messages/inbox/. I want to be able to turn that into Messages Inbox.
I am not sure which regex to use and how to do this. Currently I have this, but this is just way too messy for me.
var href = event.value != '/' ? event.value : '/wall/';
var ...
I need to transform a string such as "my name is thomos" to "ym eman si somoht". What do I need to know in order to do that?
...
i want to check lot's of thing in a string like i want to check 35 times different differnet index of on a string like
string = "i am steven"
i want to check that string have i or am and steven and some other thing. if i use indexof on this that code look like ugly then how i can apply all index of on string.
...
Hi, I have this string:
Tue,Sep,21,15:48:1,CEST,2010
I would replace the "," with a space.
I have tried:
string=string.replace("/,/g"," ");
and the result is:
Tue,Sep,21,15:48:1,CEST,2010
I have tried:
string=string.replace(","," ");
and the result is:
Tue Sep,21,15:48:1,CEST,2010
How can I replace all the "," with " "?
...
I need a helper that can identify all the nouns on a string.
If the given string is
I really enjoy eating tomatoes
I should have, as result
really, enjoy, and tomatoes
If there is a way that I can also idetify the verbs, should be great!
...
Hello,
"Yet another string function" question for TSQL.
The ExecutionLogStorage table in the ReportServer$InstanceName database for SSRS 2008 puts all parameters called to the report in a single column -
FullName=LastName, FirstName&CalledBy=Lastname, FirstName&DateSelected=MM/DD/YY&CheeseorFries=Fries
Some are null values, so the u...
Need a function to strip off a set of illegal character in javascript: |&;$%@"<>()+,
This is a classic problem to be solved with regexes, which means now I have 2 problems.
This is what I've got so far:
var cleanString = dirtyString.replace(/\|&;\$%@"<>\(\)\+,/g, "");
I am escaping the regex special chars with a backslash but I am h...
I am trying to reverse the order of words in a sentence by maintaining the spaces as below.
[this is my test string] ==> [string test my is this]
I did in a step by step manner as,
[this is my test string] - input string
[gnirts tset ym si siht] - reverse the whole string - in-place
[string test my is this] - reverse t...
Im sarching how to create a safe filename in my webapplication I had read a lot of post around here last one http://stackoverflow.com/questions/62771/how-check-if-given-string-is-legal-allowed-file-name-under-windows but I can't find the solution for this example when the filename comes in the way "fileName ..pdf" (double dot), the brows...
Need a little help with string formatting...
I have a string like this:
Bmw m3 fully equipped and low mileage
I need to replace whitespaces with commas, and also at the same time remove all special characters (all non number non letter characters except swedish å ä ö)
Then I need to remove all but the first 5 words, or you could say ...
Let's say I have this:
$array = array("john" => "doe", "foe" => "bar", "oh" => "yeah");
foreach($array as $i=>$k)
{
echo $i.'-'.$k.',';
}
echoes "john-doe,foe-bar,oh-yeah,"
How do I get rid of the last comma?
...
I have two strings containing letters and numbers separated by spaces. ex
"elza7ma wa2fa fel matab" and "2ana ba7eb el za7ma 2awy 2awy"
What is the fastest way to compare this two string to find out whether or not they have a word in common?
I tried to split one of them using string.split and use string.compare on the whole array of w...
Is there a simple trick to isolate the first sentence in a large string of text? (Perhaps using regular expressions.)
Searching for the first fullstop "." doesn't work, as acronyms such as "U.S.A." will screw things up.
(There probably is no right answer.)
...
I have a string with some spaces in it, and would like to split on the last space, and return the part of the string before that space. Does Postgres support this? I have not been able to solve this with the usual split_part-type functions.
Example : "fort worth tx" -> "fort worth"
...