Possible Duplicate:
Why does simple C code receive segmentation fault?
Hey Everyone, I'm sure this is a very basic question, but apparently I'm not quite understanding something here.
I've been playing around with C a lot over winter break and just came across something that I thought would work but is giving me a segmentation ...
Why do we have length of an array as an attribute. array.length and for String we have a method str.length()?
Just came in my mind, is there some reason?
...
Hello everybody!
How can i cut off the last empty space?
a = ['Hello ','everybody ','! ']
for i in range(len(a)):
a[i,-1]=''
print a
...
I would like to alert each individual letter of a string, but I am unsure how to do this.
So, if I have:
var str = 'This is my string';
I would like to be able to separately alert T, h, i, s, etc. This is just the beginning of an idea that I am working on, but I need to know hot to process each letter separately.
I am wanting to us...
How can I delete the \n and the following letters? Thanks a lot.
wordlist = ['Schreiben\nEs', 'Schreiben', 'Schreiben\nEventuell', 'Schreiben\nHaruki']
for x in wordlist:
...?
...
Is it possible to store a string and 11 integers in the same object.
Thanks,
Alex
...
eg : I would like to seperate
OS234 to OS and 234
AA4230 to AA and 4230
I have used following trival soultion ,but I am quite sure that there should be some more efficient and robust solution .
private void demo()
{ string cell="ABCD4321";
int a = getIndexofNumber(cell);
string Numberpart = cell.Substring(a, cell...
In some languages (e.g. C++) you can't use operators like == for string comparisons as that would compare the address of the string object, and not the string itself. However, in C# you can use == to compare strings, and it will actually compare the content of the strings. But there are also string functions to handle such comparisons, s...
How can I get how many times a string occurs in a textbox?
I thought the find function would return the number of times found but it seems to return the location of it.
...
cramming for a c++ exam, on string manip with some example questions (to which i dont have solutions) - below is today's handiwork. although it works fine - would be awesome if any obvious lapses / better way of doing things occur to you, just drop me a quick note, i need to learn me some C++ fast :)
thanks!
#include <iostream>
#includ...
How can i turn this:
<? echo json_encode($myArrays); ?>
...into this:
_rowData: [
{ name: "Most Recent", view: "recentView" },
{ name: "Most Popular", view: "popularView" },
{ name: "Staff Picks", view: "staffView" }
],
My script returns that ^, but i dont know how to put the data into the string, _rowData ?
P.S. I am...
I have a Unicode string and dont know what its encoding is. When this string is read by a Perl program, is there a default encoding that Perl will use? If so, how can I find out what it is?
I am trying to get rid of non-ASCII characters from the input. I found this on some forum that will do it
my $line = encode('ascii', normalize('KD'...
Hello! I want to change every letter in a text to after next following letter. But this program doesnt work. Does anyone know why. Thanks in advance. There is also a minor problem with y and z.
import string
letters = string.ascii_lowercase
text=("g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb ...
I want to get the first letter of a string and I've noticed that $str[0] works great. I am just not sure whether this is 'good practice', as that notation is generally used with arrays. This feature doesn't seem to be very well documented so I'm turning to you guys to tell me if it's all right in all respects to use this notation?
Or ...
im new to preg and wants to find some strings i got in an array and emphasize each one.
eg.
array[0] = "windows";
array[0] = "windows xp";
text will be: <em>windows</em> is bla bla...<em>windows xp</em> is bla bla
how could i do that?
...
It got me stuck for an hour. I happened to have a string constant with about 280 characters in it.
I was trying to use Pos to look for a substring within a long string constant. It gives the result 0 when the string is longer than 255 characters, but gives the correct result when the string is shorter.
e.g.:
pos('5', '123456789.12345...
f = open('transaction.log','r')
ClerkHash = dict()
arr = [0,0]
for line in f:
Tdate = line[0:12]
AccountKey = line[12:50]
TransType = line[22:2]
ClerkKey = line[24:10]
CurrencyCode = line[34:2]
Amount = line[36:45]
print line
print '\n'
print AccountKey
print '\n'
pri...
Please, help me to identify problem in my C# code(WPF, event-handler):
private void Discount5Btn_Click(object sender, RoutedEventArgs e)
{
decimal catPr;
decimal salePr;
string catPrStr;
catPrStr = PriceCatTBox.Text;
catPr = decimal.Parse(catPrStr);
salePr = decimal.Multiply(ca...
After I convert a decimal value salePr to string, using following code:
decimal salePr;
string salePrStr;
...
salePrStr = (salePr).ToString("0000.00");
'''
I'd like to get rid of leading zeros (in case result is <1000).
What is right and the best way to do this operation?
...
Hello folks,
today I was wondering if there is a better solution perform the following code sample.
string keyword = " abc, foo , bar";
string match = "foo";
string[] split= keyword.Split(new char[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries);
foreach(string s in split)
{
if(s.Trim() == match){// asjdklasd; break;}
}
I...