I'm really not loving Perl but I've got to use it for my current task.
Here is my problem... I have three strings, that make up elements of a full directory path (windows, but needs to work on *nix too). For example...
$root = "c:\\checkout\\omega";
$client = "abc\\mainline";
$build = "omega\\abc\\mainline\\host\\make";
I want to co...
I'm working in lua, and i need to match 2 parts of a line that's taken in through file IO. I'm inexperienced with regexes and i'm told lua doesn't have full regex support built in (but i have a library that provides that if need be). Can someone help me with building regexes to match the parts necessary?
"bor_adaptor_00.odf" 3.778
...
I need to do a simple split of a string, but there doesnt seem to be a function for this, and the manual way i tested didn't seem to work. How would i do it?
...
I have an array like this:
object[] args
and need to insert those args in a string, for example:
str = String.Format("Her name is {0} and she's {1} years old", args);
instead of:
str = String.Format("Her name is {0} and she's {1} years old", args[0], args[1]);
NOTE: Actually the first line of code worked! But args[1] was missing...
I need to split a string let's say "asdf aA asdfget aa uoiu AA" split using "aa" ignoring the case.
to
"asdf "
"asdfget "
"uoiu "
...
I'm pretty sure regular expressions are the way to go, but my head hurts whenever I try to work out the specific regular expression.
What regular expression do I need to find if a Java String (contains the text "ERROR" or the text "WARNING") AND (contains the text "parsing"), where all matches are case-insensitive?
EDIT: I've presented...
I'm working on writing a simple Prolog interpreter in Java.
How can I find the last character index of the first element either the head element or the tail element of a string in "List Syntax"?
List Syntax looks like:
(X)
(p a b)
(func (func2 a) (func3 X Y))
(equal eve (mother cain))
The head for each of those strings in...
I'm looking for an efficient algorithm to do string tiling. Basically, you are given a list of strings, say BCD, CDE, ABC, A, and the resulting tiled string should be ABCDE, because BCD aligns with CDE yielding BCDE, which is then aligned with ABC yielding the final ABCDE.
Currently, I'm using a slightly naïve algorithm, that works as f...
I have a multi-line string like this:
"...Togo...Togo...Togo...ACTIVE..."
I want to get everything between the third 'Togo' and 'ACTIVE' and the remainder of the string. I am unable to create a regular expression that can do this. If I try something like
reg = "(Togo^[Togo]*?)(ACTIVE.*)"
nothing is captured (the first and last par...
I have some string data in the following format: "Ronit","abc""defgh","abcdef,"fdfd",
Can somebody suggest some good code in C++ to return the comma-separated tokens, when the commas are not inside a string?
I.e. it should return
"Ronit"
"abc""defgh"
"abcdef,"fdfd"
to be more clear
Thanks all of you for kind help.
Below is my sam...
I'm using a JavaScript component that takes a 2D array as an input. There is a particular format to it, and I basically need to develop grid GUI to help configure such a string, instead of having to type it manually.
[
[0,"Chart","linear"],
[2,"3D",false],
[1,"Labels",["Student","Business","Professional","Retired"]]
]
Any ideas ...
E.g. Input string str = "1111222233334444";
return value ArrayList A where A[0] = "1111", A[1] = "2222", etc.
Use of Linq or reg ex would be good.
...
How can i remove all characters except numbers from string?
...
I've spent the last hour and a half trying to figure out how to run a simple search and replace on a string object in C++.
I have three string objects.
string original, search_val, replace_val;
I want to run a search command on original for the search_val and replace all occurrences with replace_val.
NB: Answers in pure C++ only. Th...
I want to replace the text in a string "Sin()" with the computed value for Math.Sin() where is...anything.
My problem: The string can have more than one right parenthesis. Also, since it is performing mathematical operations, it would have to know how to do the innermost ones first.
Obviously, there is not a built in method for comput...
I am writing a script to find the number of occurrences of a particular substring in a string in XSLT. I think it's taking too much time when I want to traverse it in more than two lakh records. Can anyone help me to point out some changes to make it faster, or some other way to get the number of occurrences?
Remember that I am taking a...
i have here a code that gets a portion of a record on my database and display it and has a link ("Read More") that renders the viewer to the detailed page of that record..
<% Dim id As Integer = _news.Rows(count).Item("IDnews")%>
<%=_news.Rows(count).Item("newsTitle")%>
<img src='<%= Url.Content("~/NewsPictures/" + _news.Ro...
Hey, i try to trim each string item of an list in groovy
list.each() { it = it.trim(); }
But this only works within the closure, in the list the strings are still " foo", "bar " and " groovy ".
How can i achieve that?
...
Is there way of generating a string made up of 250 underscores, without using a loop?
I want to avoid writing code like this:
var myString= '';
for (var i=0; i < 250; i++) {
myString += '_';
}
...
I'm working in a modified version of Sybase 10 that doesn't have the stuff, replace or str_replace functions. I need to replace part of string in a number of records.
Are there any creative ways to program around this, so I don't have to do them all manually?
Example:
UPDATE status
SET description = replace(description,'abc','def')
W...