Intention is to take a current line which contains commas, store trimmed values of all space and store the line into the array.
Why does this not work?
String[] currentLineArray = currentInputLine.replace("\\s", "").split(",");
Hello,
I have this string: '30/05/2010', and I would like to enter it to a smallDatetime field.
In the database it should look something like this 2010-05-30 15:33:25
Any Idea how?
TY
I have a string like
Pakistan, officially the <a href="Page.aspx?Link=Islamic Republic of Pakistan">Islamic Republic of Pakistan</a>
Now I am using
System.Text.RegularExpressions.Regex.Replace(inputText, "(\\bPakistan\\b)", "something");
to replace Pakistan outside the tags. But I don't want to replace Pakistan occurring within the <a></a> tags.
Hello guYz plz help me out in making it possible to open the files by the adress provided in an array of strings.........
a way to open file is as given below...
ifstream infile;
infile.open("d:\aslam.txt");
but how can i open file providing an array of string as an adress of file.....
like this
infile.open(arr[i]); (but its not working)
plz help me.........
Is there any alternative to this:
Organizations.Include("Assets").Where(o => o.Id == id).Single()
I would like to see something like:
Organizations.Include(o => o.Assets).Where(o => o.Id == id).Single()
to avoid the hard-coded string "Assets".
In python:
s = '1::3'
a = s.split(':')
print a[0] # '1' good
print a[1] # '' good
print a[2] # '3' good
How can I achieve the same effect with zsh?
The following attempt fails:
s="1::3"
a=(${(s/:/)s})
echo $a[1] # 1
echo $a[2] # 3 ?? I want an empty string, as in Python
Using Python I need to delete all charaters in a multiline string up to the first occurrence of a given pattern. In Perl this can be done using regular expressions with something like:
#remove all chars up to first occurrence of cat or dog or rat
$pattern = 'cat|dog|rat'
$pagetext =~ s/(.*?)($pattern)/$2/xms;
What's the best way to do it in Python?
for(int i = 1;i<100;i++)
string strI = i.tostirng();
in here, if i is 1 then strI is '1'
But I want to get '01'
or '001'
it looks quite easy. but there's only article about datetime.tostring("yyyy-MM-dd") :(
Hi,
How can i print only certain words from a string in python ?
lets say i want to print only the 3rd word (which is a number) and the 10th one
while the text length may be different each time
mystring = "You have 15 new messages and the size is 32000"
thanks.
How can we get the numbers 7 and 4 and 5 from the following string:
MODULE potmtpMAIN main
<info: "Enterprise Optimizer 7.4 for COR Technology 5.5 -- Advanced Solver Edition", url:"http://EO.riverlogic.com", url_menu:"EO Online...", app_id:"EOAS",app_name:"Enterprise Optimizer AS", **app_major:7**, **app_minor:4**,**app_micro:5**,app_copyright:"\251 1996-2010 River Logic Inc.\r\nAll Rights Reserved.">
Thank You in advance
folks, i have a string like
AxxBCyyyDEFzzLMN
I want to replace all x and y and z with _ so that the output is
A_BC_DEF_LMN
How to do that?
I know a series of tr 'x' '' | tr 'y' '' will work, but I want to do taht in one go, without using pipes
thanks in advance
I have a client who is wanting to create a link which contains product codes so that his customers hit a page with just those products displayed in an attempt to increase conversion rates from affilliate sites.
My question is whats the best way to send these multiple products in a single URL
For example:
http://www.mydomain.co.uk/bespoke-list.php?catNo=234-324-232-343
Obviously then the site would grab the codes from the string and display them...
We're going to be using PHP!
Thanks in advance.
I want to convert an int to a string but if it is a single digit I want to add a leading 0
Is that one of the built in format options? or do I have to do it manually?
I am working with ruby 1.8.6 (2007-03-13 patchlevel 0) [x86_64-linux] and I get
undefined method `bytes' for #<String:0x2a95ec2268> (NoMethodError)
even though my code works on ruby 1.8.7. patchlevel 249
I saw somewhere that you need to add require "jcode" for a similar method not defined error with each_byte. I tried adding that but it still does not work. Any suggestions are very appreciated.
var_dump('<a>')
// or
var_dump("<a>")
// or
var_dump("\x3Ca>")
// all result in
string(3) ""
What is going on? Only putting a space after the less-than sign works for me.
PHP Version 5.2.10-2ubuntu6.4
The post office actually publishes a list of commonly used street suffixes in addresses:
http://www.usps.com/ncsc/lookups/abbr_suffix.txt
I want to take this list and make a ruby function that takes a string, takes the last word ("183 main strt".split[' '].last) and if it matches any of the commonly used street suffixes ("strt"), replace it with the official Postal Service Standard Suffix ("st").
Is there a better way to approach this than a massive str.sub.sub.sub.sub.sub?
I have a list of
uids: ['1234','4321','1111']
and I would like to turn this into a single string of:
"uid = '1234' OR uid = '4321' OR uid = '1111'"
What's the most efficient way to do this?
Thanks!
Well i'm learning Python cuz' i think is an awesome and powerful language like C++, perl or C# but is really really easy at same time. I'm using JetBrains' Pycharm and when i define a function it ask me to add a "Documentation String Stub" when i click yes it adds somethin like this:
"""
"""
so the full code of the function is something like this:
def otherFunction(h, w):
"""
"""
hello = h
world = w
full_word = h + ' ' + w
return full_word
I would like to know what these (""" """) symbols means, Thanks.
Ps.Data: Sorry for my bad english :D
How should I pass a stringto the view controller that gets pushed when a tableviewcell is selected.
Should I create a custom init method in the view controller? eg [[myvc alloc]initWithURL:...]
Set a property? eg [myvc setURL:...] or myvc.url = ...
or just create a custom method? [myvc setLoadingURL:...]