For doing string concatenation I've been doing basic strcpy,strncpy of char* buffers.
Then I learned about the snprintf and friends.
Should I stick with my strcpy,strcpy + \0 terminiation.
Or should I just use snprintf in the future?
thanks
...
Ok i have this problem... I want to take out some text from a string and that text is held between () brackets and the string looks like this var a = validate(password) I want to take out the password ;)
thx in forward
Vanja
...
Sorry if this question is answered already, but I didn't find a suitable answer.
I am having a string expression in C# which I need to convert to an int or decimal value.
For example:
string strExp = "10+20+30";
the output should be 60.
how shall I do that???
...
I want to know how to replace the string in Java.
E.g.
String a = "adf�sdf";
How can I replace and avoid special characters?
...
It's the reverse of this question: http://stackoverflow.com/questions/93091/why-cant-strings-be-mutable-in-java-and-net
Was this choice made in Ruby only because operations (appends and such) are efficient on mutable strings, or was there some other reason?
(If it's only efficiency, that would seem peculiar, since the design of Ruby se...
char p[4]={'h','g','y'};
cout<<strlen(p);
This code prints 3.
char p[3]={'h','g','y'};
cout<<strlen(p);
This prints 8.
char p[]={'h','g','y'};
cout<<strlen(p);
This again prints 8.
Please help me as I can't figure out why three different values are printed by changing the size of the array.
...
EDIT: I don't want to delete the post because I have learned a lot very quickly from it and it might do someone else good, but there is no need for anyone else to spend time answering or viewing this question. The problems were in my programming fundamentals, and that is something that just can't be fixed in a quick response. To all w...
In the interpreter for my programming languages I have to correctly handle the parts in case the import function is called. I then need to check if such a file is in the /libs folder (located at the same place as my executeable!) and if it doesn't exist I have to check in the directory of the current script.
How can I get the exact pat...
I have this string that shall come in from another file. The string has maximum length of 102 digits. I need to compare the string with numbers in a pair and delete those from that string.
e.g - 6125223659587412563265... till 102
numbers that compare with this string-
first set - 61
new string = 25223659587412563265
second set - 36...
I need to pass a string literal to a function
myfunction("arg1" DEF_CHAR "arg1");
now part of that constructed string literal needs to be a function return
stmp = createString();
myfunction("arg1" stmp "arg2"); //oh that doesn't work either
is there any way to do this in one line?
myfunction("arg1" createString() "arg2"); //what i...
I'm trying to make a class where I put a key and value into the put method which puts the key in the k string array and value into the v string array, however it is not being saved in the array when I do get or display.
For example: put(dan,30) get(dan) returns null
display returns null null 10 times. Does anyone know what's wrong?
publ...
Hi,
I have a string that ends with a " (quotation mark) that I want to get rid of. However, because XCode usually requires you to enter the text you wish to remove using stringByReplacingOccurrencesOfString in @"texttoremove" format, you can't use the quotation marks in the space as it thinks you are closing the text.
Update: Now I can...
i would like to do bitwise exclusive or of words in python but xor of strings are not allowed in python . so how to do it ?
...
OK. For example I have this line in my txt file:
1|1,12;7,19;6,4;8,19;2,2
As you can see, it has 2 parts, separated by |. I have no problems getting both parts, and separating second part 1,12;7,19;6,4;8,19;2,2 using ; separator. BUT I do have problems with separating further by , to get first and second number of each set.
This is my ...
how to print reverse of String "java is object orientated language" without using any predefine function like reverse() in java? any idea.
...
Hello,
I am looking for the fastest way to remove duplicate values in a string separated by commas.
So my string looks like this;
$str = 'one,two,one,five,seven,bag,tea';
I can do it be exploding the string to values and then compare, but I think it will be slow. what about preg_replace() will it be faster? Any one did it using this...
Hi,
I was experimenting with basic VB.Net File IO and String splitting. I encountered this problem. I don't know whether it has something to do with the File IO or String splitting.
I am writing text to a file like so
Dim sWriter As New StreamWriter("Data.txt")
sWriter.WriteLine("FirstItem")
sWriter.WriteLine("SecondItem")
sWriter.Wri...
Ok guys I imagine this is easy but I can't seem to find how to copy a string. Simply COPY to the system like CTRL+C on a text.
Basically I want to copy a string so I can for example, lets say, paste(ctrl+v).
Sorry for such a trivial question, haha.
...
String match = "hello";
String text = "0123456789hello0123456789";
int position = getPosition(match, text); // should be 10, is there such a method?
...
I have strings that look about like this:
stringA = @"29.88";
stringB = @"2564";
stringC = @"12";
stringD = @"-2";
what is the best way to convert them so they can all be used in the same mathmatical formula?? that includes add, subtract.multiply,divide etc
...