how to execute an for loop till the queue is emptyin c++
hello, i need to execute an for loop till the queue is empty my code queue<string> q; for(int i=0;i<q.size(),i++) { // some operation goes here // some datas are added to queue } ...
hello, i need to execute an for loop till the queue is empty my code queue<string> q; for(int i=0;i<q.size(),i++) { // some operation goes here // some datas are added to queue } ...
Hi, If I am looking for a particular word inside a string, for example, in the string "how are you" I am looking for "are". Would a regular indexOf() work faster and better or a Regex match() String testStr = "how are you"; String lookUp = "are"; //METHOD1 if (testStr.indexOf(lookUp) != -1) { System.out.println("Found!"); } //OR //...
I want to ask a Java String[] question. In the java, if a variable convents to another, it can add the (String), (int), (double),... before the variable in the left hand side. However, is there something like (String[]) in Java as I want to convent the variable into (String[]). ...
Hi, everyone, I have a question about Java. I have an Object[] (Java default, not the user-defined) and I want to convert it to a String[]. Can anyone help me? thank you. ...
i want to split the String = "Asaf_ER_Army" by the "ER" seperator. the Split function of String doesn't allow to split the string by more than one char. how can i split a string by a 'more than one char' seperator? ...
Quick question here. I'm converting an array into a string using String.Join. A small issue I have is that, in the array some index positions will be blank. An example is below: array[1] = "Firstcolumn" array[3] = "Thirdcolumn" By using String.Join(",", array);, I'll get the following: Firstcolumn,,Thirdcolumn Note the extra ,. ...
Hello, string DelStr = "I! am! bored!"; string RepStr = "10/07/10" I want to delete all '!' on DelStr and I want to replace all '/' with '-' on the RepStr string. Is there any way to do this without doing a loop to go through each character? ...
I need to extract a description from a file, which looks like this: "TES4!\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00HEDR\x0c\x00\xd7\xa3p?h\x03\x00\x00\x00\x08\x00\xffCNAM\t\x00Martigen\x00SNAM\xaf\x00Mart's Mutant Mod - RC4\n\nDiverse creatures & NPCs, new creatures & NPCs, dynamic size and stat scaling...
Hey, I'm using htmlentities() to convert characters like Ç and ® to its character codes. I'm getting the texts from the MYSQL database. while($row = mysql_fetch_array($array, MYSQL_NUM)){ echo "<div style='float:left; margin-right:40px;'> <div style='width:148px; height:141px; background-image:url(uploads/".$row[0].")'> <img src...
Hi all, I need to be able to convert all input fields in a DetailsView (Insert) to uppercase. How do I do this? My SQL query and the whole insert statement takes place in ASP.NET, and not in code behind so I'm not sure if I can dynamically do this in ASP. I've used Text-Transform in CSS to make them look uppercase for the user, but it s...
I'm writing a document and I have a few chapter titles that I would like to appear as 2 lines for a chapter title, but only one line in the table of contents. Is there a simple command I to filter out the newline character like this? Chapter Title First Line: Second more informative line ToC: First Line: Second more infor...
Hi all first a short summery: python ver: 3.1 system: Linux (Ubuntu) I am trying to do some data retrieval through Python and BeautifulSoup. Unfortunately some of the tables I am trying to process contains cells where the following text string exists: 789.82 ± 10.28 For this i to work i need two things: How do i handle "weird" sym...
I am trying to split a string into an array of word pairs in PHP. So for example if you have the input string: "split this string into word pairs please" the output array should look like Array ( [0] => split this [1] => this string [2] => string into [3] => into word [4] => word pairs [5] => pairs please ...
Question: I have found that java.net.URI has a create(String uri) option but the android.net.uri does not. More Specific: I am trying to grab the output of RingtoneManager's RingtonePicker and set it as the default ringtone with SetActualDefaultRingtoneUri; Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER); intent.pu...
When should one compare Strings as objects and when should one use their equals method? To make sure, I always use equals, but that doesn't seem very efficient. In what situations can I be certain that string1 == string2 is a safe to use? Thanks! ...
Hello! I have a problem storing a PHP loop in a variable. The loop is like this: for( $i = 1; $i <= 10; $i++ ) { echo $i . ' - '; } for this it's OK for an echo or print as it will produce: 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - now I want to store the whole loop in a variable like $my_var which means: echo $my_var; ...
Hi, i want to set the name of an object like UIButton from a string. NSString *string = [[NSString alloc] initWithString:@"someString"]; UIButton *(string) = [[UIButton buttonWithType:UIButtonTypeCustom]retain]; My goal is: UIButton *someString = [[UIButton buttonWithType:UIButtonTypeCustom]retain]; how can i solve this? ...
Please explain me the working of strtok() function.The manual says it breaks the string into tokens. I am unable to understand from the manual what actually it does. I added watches on str and *pch to check its working, when the first while loop occurred, the contents of str were only "this". How did the output shown below printed on th...
I'm working on embedding Python 2.6 into an existing c++ application. So far I have the Libraries linked in and am able to successfully initialize the Python Interpreter and can also transfer data to Python. I'm having trouble retrieving it, and hope someone can steer me the right direction. I'm working with this: Py_Initialize(); p...
string template = @" { argument1 = ""{0}""; argument2 = {1}; }"; When I format it as a usual string with string.Format, naturally i get an exception that the input string was not in correct format. I tried escaping the arguments as it is recommended in msdn documentation, like "{{0}...