How do I extract part of a string in t-sql
If I have the following nvarchar variable - BTA200, how can I extract just the BTA from it? Also, if I have varying lengths such as BTA50, BTA030, how can I extract just the numeric part? ...
If I have the following nvarchar variable - BTA200, how can I extract just the BTA from it? Also, if I have varying lengths such as BTA50, BTA030, how can I extract just the numeric part? ...
i've god a simple piece of code: public string GenerateRandomString() { string randomString = string.Empty; Random r = new Random(); for (int i = 0; i < length; i++) randomString += chars[r.Next(chars.Length)]; return randomString; } If i call this functi...
In Python, the where and when of using string concatenation versus string substitution eludes me. As the string concatenation has seen large boosts in performance, is this (becoming more) a stylistic decision rather than a practical one? For a concrete example, how should one handle construction of flexible URIs: DOMAIN = 'http://stack...
Suppose I have a variable of type Int = 08, how can I convert this to String keeping the leading zero? For instance: v :: Int v = 08 show v Output: 8 I want the output to be "08". Is this possible? ...
I am trying to get the size of an array populated by stdin: char *myArray; cin >> myArray cout << sizeof(myArray); This returns 4 when I enter a string greater with a length greater than 4 e.g. "40905898" Where am i going wrong? ...
Hey there, I've got a block of HTML that I'm going to be using repeatedly (at various times during a users visit, not at once). I think that the best way to accomplish this is to create an HTML div, hide it, and when needed take its innerHTML and do a replace() on several keywords. As an example HTML block... <div id='sample'> <h4>%...
Looking for advice (perhaps best practice) We have a MS Word document (office 2007) that we are extracting text from a cell. We can use the following: string text = wordTable.cell(tablerow.index, 1).Range.Text; The text is extracted; however we seem to get extra characters trailing, example "\r\a". Now we could add the following: ...
I need to convert a name in the format Parisi, Kenneth into the format kparisi. Does anyone know how to do this in Perl? Here is some sample data that is abnormal: Zelleb, Charles F.,,IV Eilt, John,, IV Wods, Charles R.,,III Welkt, Craig P.,,Jr. These specific names should end up as czelleb, jeilt, cwoods, cwelkt... etc ADDITION+++++ ...
Is there a library that will convert a Double to a String with the whole number, followed by a fraction? For example 1.125 = 1 1/8 I am only looking for fractions to a 64th of an inch. ...
Hi, I want in a good performance way (I hope) replace a named parameter in my string to a named parameter from code, example, my string: "Hi {name}, do you like milk?" How could I replace the {name} by code, Regular expressions? To expensive? Which way do you recommend? How do they in example NHibernates HQL to replace :my_param to ...
I am using this example: char *myData[][2] = {{"John", "[email protected]"}, {"Erik", "[email protected]"}, {"Peter","[email protected]"}, {"Rikard","[email protected]"}, {"Anders","[email protected]"}}; char **tableData[6]; tableData[0] = myData[0]; tableData[1] = myData[1]; tableData[2] = myData[2]; tableData[3] = myData[3]; tableData[4] = ...
This should be simple - In python, how can I parse a numeric string like "545.2222" to its corresponding float value, 542.2222 or "31" to an integer, 31? EDIT: I just wanted to know how to parse a float string to a float, and (separately) an int string to an int. Sorry for the confusing phrasing/original examples on my part. At any r...
I'm trying to make a database and so far, I've been using strings to store my entries from a text file into an array, but this just isn't working out. Thus, I began thinking of a new way of doing it. What I want to do: Lets say I have a text file with the following database... John Smith 00001 jsmith@email pw1 Rob Deniro 00002 ...
$rowfetch =~ s/['-]//g; #All chars inside the [ ] will be filtered out. $rowfetch =~ m/(\w+), ?(.)/; printf $fh lc($2.$1); I got help building this regular expression yesterday, but I don't fully understand it.It takes a name like Parisi, Kenneth and prints out kparisiKnowns:s/ = substitutem/ = matchI tried searching for the rest...
More specifically, I'm trying to check if given string (a sentence) is in Turkish. I can check if the string has Turkish characters such as Ç, Ş, Ü, Ö, Ğ etc. However that's not very reliable as those might be converted to C, S, U, O, G before I receive the string. Another method is to have the 100 most used words in Turkish and check...
I have an NSAttributedString s and an integer i and I'd like a function that takes s and i and returns a new NSAttributedString that has a (stringified) i prepended to s. It looks like some combination of -stringWithFormat:, -initWithString:, and -insertAttributedString: would do it but I'm having trouble piecing it together without a l...
Help me people Last week I asked about unicode conversion.I got only one reply.I need more suggestions. I need to convert strings in Python to other types such as unsigned and signed int 8 bits,unsigned and signed int 16 bits,unsigned and signed int 32 bits,unsigned and signed int 64 bits,double,float,string,unsigned and signed 8 bi...
I want to convert strings to bit-fields.Also,convert them to binary and then use. Need help with this..help me .. ...
I have this quiz application where I match what people type with the right answer. For now, what I do is basically that : if ($input =~ /$answer/i) { print "you won"; } It's nice, as if the answer is "fish" the user can type "a fish" and be counted a good answer. The problem I'm facing is that, well, my users as I are french, an...
Is there a method built in to NSString that tokenizes the string and searches the beginning of each token? the compare method seems to only do the beginning of a string, and using rangeOfString isn't really sufficient because it doesn't have knowledge of tokens. Right now I'm thinking the best way to do this is to call [myString comp...