Search Results

Search found 37183 results on 1488 pages for 'string conversion'.

Page 145/1488 | < Previous Page | 141 142 143 144 145 146 147 148 149 150 151 152  | Next Page >

  • removing comma from string array

    - by sarah
    Hi, I want to execute a query like select ID from "xyz_DB"."test" where user in ('a','b') so the corresponding code is like String s="("; for(String user:selUsers){ s+= " ' " + user + " ', "; } s+=")"; Select ID from test where userId in s; The following code is forming the value of s as ('a','b',) i want to remove the comma after the end of array how to do this ?

    Read the article

  • How to filter items in a ListBox based on a searched string

    - by tiz
    Hi all, I have a Windows Forms application (C#) containing a ListBox into which I have added some items (I'm not using a DataSource). I want to filter the items in the ListBox to show only items containing a string I'm searching for. I have done this by keeping a list of the original items and selecting matching items from that list each time the search string changes and updating the ListBox.Items Is there a more elegant/efficient way to do this?

    Read the article

  • spliting the string

    - by prince23
    hi, i have an string like this string strdate =@"5/2/2006"; which is in a form of month/day/year i need to display it in a form of like this 02-05-2006 how do i format the data like this if the value is like this 12/28/2005 it should be displayed like this 28-12-2010 i know we should be splitting the data based on that we should do it. i am not getting the syntax how to do it . any help would be great

    Read the article

  • writing string into file before calling the close()

    - by navinbecse
    I am using ofstream() to write data into file, i want to program to perform such a way that it should be keep on writting the string into the file as soon as the value gets assingned to string variable, and it should be writting before calling the close() for the buffer and while the program runs itself. can anyone help me to do that in c++.........

    Read the article

  • copy string one place to another

    - by gcc
    how can i copy part of the specific string to the another place example (aaa),(ddd),(fff),(fff),#p copy (ddd) to the side of the p (aaa),(fff),(fff),#p,(ddd) //before copyin add comma copy (fff) to side of the (ddd) (aaa),(fff),#p,(ddd),(fff) //string lenght always same

    Read the article

  • Map to String in Java

    - by Dan
    When I do System.out.println(map) in Java, I get a nice output in stdout. How can I obtain this same string representation of a Map in a variable without meddling with standard output? Something like String mapAsString = Collections.toString(map)?

    Read the article

  • Regular expression - skip string in quotes using sed

    - by milano
    I have string like this: "Some standard text CONST_INSIDE_QUOTES" blah blah CONST "There might be another quotes" The thing is, that i want to replace all constants in string with some text, but it mustn't be applied on constants inside text in quotes. I have this regex: sed "s/([A-Z][A-Z0-9_]*)([^a-z])/<span class=\"const\"\1<\/span\2/g" which of course works for all consts. Any ideas how to exclude its apply on quotes constants? Unfortunately sed only...

    Read the article

  • Including huge string in our c++ programs ?

    - by Xinus
    I am trying to include huge string in my c++ programs, Its size is 20598617 characters , I am using #define to achieve it. I have a header file which contains this statement #define "<huge string containing 20598617 characterd>" When I try to compile the program I get error as fatal error C1060: compiler is out of heap space I tried following command line options with no success /Zm200 /Zm1000 /Zm2000 How can I make successful compilation of this program? Platform: Windows 7

    Read the article

  • occurance of string

    - by David
    i know you can find the first and last occurrence in a string using strstr() and strchr but how do i find the second occurrence, and the third occurrence of needle inside haystack? im using this to find the last occurrence of needle and the first occurrence of another needle and their position, then return the string that is in between each. thank you.

    Read the article

  • Limited-length string class

    - by wood_brian
    Is there a limited-length string class around? I've searched a little on the net and didn't find anything. I'm interested in a class that limits (possibly at compile time) the length to 255, so marshalling the string's length only requires one byte.

    Read the article

  • how to search a string in structure variable ( C# )

    - by deep
    public struct Items { public string Id; public string Name; } public Items[] _items = null; if (_items.Contains("Table")) { // i need to check the structure and need to return correponding id } and am having a list of variables in my structure variable... i need to search a Name in the structure(_items) and i want to return the Corresponding Id. how to do this,

    Read the article

  • When I do ""+1 I get a String - Why

    - by steve
    Hi, Please understand firstly that I fully understand that Java will return a String when I use ""+int. What I'm really not sure about is what exactly is happening down at the memory aspect. How exactly is java performing this conversion. I mean this in a very indepth way, not 'auto boxing' or anything like that :) I'm hoping someone with a deeper understanding can explain what exactly is done.

    Read the article

  • Return an empty C-String

    - by Evorlor
    Simple Question: How do you return an empty C-String with as little code as possible? I have code that needs to return an empty char*. I am looking for something along the lines of return "";. I know there are several ways to do this, but I am looking for the most efficient way possible. Using return ""; gives warning: conversion from string literal to 'char *' is deprecated [-Wdeprecated-writable-strings] Thanks!

    Read the article

  • Should the 12-String be in it's own class and why?

    - by MayNotBe
    This question is regarding a homework project in my first Java programming class (online program). The assignment is to create a "stringed instrument" class using (among other things) an array of String names representing instrument string names ("A", "E", etc). The idea for the 12-string is beyond the scope of the assignment (it doesn't have to be included at all) but now that I've thought of it, I want to figure out how to make it work. Part of me feels like the 12-String should have it's own class, but another part of me feels that it should be in the guitar class because it's a guitar. I suppose this will become clear as I progress but I thought I would see what kind of response I get here. Also, why would they ask for a String[] for the instrument string names? Seems like a char[] makes more sense. Thank you for any insight. Here's my code so far (it's a work in progress): public class Guitar { private int numberOfStrings = 6; private static int numberOfGuitars = 0; private String[] stringNotes = {"E", "A", "D", "G", "B", "A"}; private boolean tuned = false; private boolean playing = false; public Guitar(){ numberOfGuitars++; } public Guitar(boolean twelveString){ if(twelveString){ stringNotes[0] = "E, E"; stringNotes[1] = "A, A"; stringNotes[2] = "D, D"; stringNotes[3] = "G, G"; stringNotes[4] = "B, B"; stringNotes[5] = "E, E"; numberOfStrings = 12; } } public int getNumberOfStrings() { return numberOfStrings; } public void setNumberOfStrings(int strings) { if(strings == 12 || strings == 6) { if(strings == 12){ stringNotes[0] = "E, E"; stringNotes[1] = "A, A"; stringNotes[2] = "D, D"; stringNotes[3] = "G, G"; stringNotes[4] = "B, B"; stringNotes[5] = "E, E"; numberOfStrings = strings; } if(strings == 6) numberOfStrings = strings; }//if else System.out.println("***ERROR***Guitar can only have 6 or 12 strings***ERROR***"); } public void getStringNotes() { for(int i = 0; i < stringNotes.length; i++){ if(i == stringNotes.length - 1) System.out.println(stringNotes[i]); else System.out.print(stringNotes[i] + ", "); }//for }

    Read the article

  • Should the 12-String be in it's own class and why? Java

    - by MayNotBe
    This is my first question here. I will amend it as instructed. This is regarding a homework project in my first Java programming class (online program). The assignment is to create a "stringed instrument" class using (among other things) an array of String names representing instrument string names ("A", "E", etc). The idea for the 12-string is beyond the scope of the assignment (it doesn't have to be included at all) but now that I've thought of it, I want to figure out how to make it work. Part of me feels like the 12-String should have it's own class, but another part of me feels that it should be in the guitar class because it's a guitar. I suppose this will become clear as I progress but I thought I would see what kind of response I get here. Also, why would they ask for a String[] for the instrument string names? Seems like a char[] makes more sense. Thank you for any insight. Here's my code so far (it's a work in progress): public class Guitar { private int numberOfStrings = 6; private static int numberOfGuitars = 0; private String[] stringNotes = {"E", "A", "D", "G", "B", "A"}; private boolean tuned = false; private boolean playing = false; public Guitar(){ numberOfGuitars++; } public Guitar(boolean twelveString){ if(twelveString){ stringNotes[0] = "E, E"; stringNotes[1] = "A, A"; stringNotes[2] = "D, D"; stringNotes[3] = "G, G"; stringNotes[4] = "B, B"; stringNotes[5] = "E, E"; numberOfStrings = 12; } } public int getNumberOfStrings() { return numberOfStrings; } public void setNumberOfStrings(int strings) { if(strings == 12 || strings == 6) { if(strings == 12){ stringNotes[0] = "E, E"; stringNotes[1] = "A, A"; stringNotes[2] = "D, D"; stringNotes[3] = "G, G"; stringNotes[4] = "B, B"; stringNotes[5] = "E, E"; numberOfStrings = strings; } if(strings == 6) numberOfStrings = strings; }//if else System.out.println("***ERROR***Guitar can only have 6 or 12 strings***ERROR***"); } public void getStringNotes() { for(int i = 0; i < stringNotes.length; i++){ if(i == stringNotes.length - 1) System.out.println(stringNotes[i]); else System.out.print(stringNotes[i] + ", "); }//for }

    Read the article

  • T-SQL While Loop and concatenation

    - by JustinT
    I have a SQL query that is supposed to pull out a record and concat each to a string, then output that string. The important part of the query is below. DECLARE @counter int; SET @counter = 1; DECLARE @tempID varchar(50); SET @tempID = ''; DECLARE @tempCat varchar(255); SET @tempCat = ''; DECLARE @tempCatString varchar(5000); SET @tempCatString = ''; WHILE @counter <= @tempCount BEGIN SET @tempID = ( SELECT [Val] FROM #vals WHERE [ID] = @counter); SET @tempCat = (SELECT [Description] FROM [Categories] WHERE [ID] = @tempID); print @tempCat; SET @tempCatString = @tempCatString + '<br/>' + @tempCat; SET @counter = @counter + 1; END When the script runs, @tempCatString outputs as null while @tempCat always outputs correctly. Is there some reason that concatenation won't work inside a While loop? That seems wrong, since incrementing @counter works perfectly. So is there something else I'm missing?

    Read the article

< Previous Page | 141 142 143 144 145 146 147 148 149 150 151 152  | Next Page >