string

Does VBScript have a substring() function?

Is there a substring() function in VBScript similar to Java's string.substring()? ...

How do I check if a string has at least one number in it using Ruby?

I need to check to see if a string contains at least one number in it using Ruby (and I assume some sort of regex?). How would I do that? ...

Case Insensitive Pattern Matching over String Lists

I'm trying to parse command line arguments in an F# application. I'm using pattern matching over parameters list to accomplish it. Something like: let rec parseCmdLnArgs = function | [] -> { OutputFile = None ; OtherParam = None } | "/out" :: fileName :: rest -> let parsedRest = parseCmdLnArgs rest ...

C++ Parse XML Using STD

I'm aware there are several XML libaries out there, but unfortunately, I am unable to use them for a school project I am working on. I have a program that created this XML file. <theKey> <theValue>23432</theValue> </theKey> What I am trying to do is parse out "23432" between the tags. However, there are random tags in the file so ...

String to Integer Smalltalk

Pretty simple question I need to get an integer from the user and I only know how to get a string from them. So if there is a way to get an integer from the user or to convert the string to an integer please let me know. ...

Not Able To Use STL's string class

Encountered this problem before but forgot how I solved it. I want to use the STL string class but the complier is complaining about not finding it. Here is the complete .h file. #ifndef MODEL_H #define MODEL_H #include "../shared/gltools.h" // OpenGL toolkit #include <math.h> #include <stdio.h> #include <string> #include <iostream> ...

Mysql cut string, the first character?

Hi is it possible to cut string like this: String in "data" columns: ,123,456 Cut the first character i.e "," (comma). So the query is something like: Update users set data = cut first string... ...

C#: Class for decoding Quoted-Printable encoding?

Is there an existing class in C# that can convert Quoted-Printable encoding to String? Click on the above link to get more information on the encoding. The following is quoted from the above link for your convenience. Any 8-bit byte value may be encoded with 3 characters, an "=" followed by two hexadecimal digits (0–9 or A–F) ...

Copying a string in C

Hi, I am confused about this code: (http://www.joelonsoftware.com/articles/CollegeAdvice.html) while (*s++ = *t++); What is the order of execution? Is *s = *t first done, and then are they each incremented? Or other way around? Thanks. EDIT: And what if it was: while(*(s++) = *(t++)); and while(++*s = ++*t); ...

formatting currencies with Python

I would like to format integers as professional looking currency strings. For example: 1200000 -> $1.2 million 456 -> $456.00 Do you know a good library for this, ideally with localization to handle European formats. ...

c++ strtok problem

i'm trying to create a map of word==>drow, like polindrom... the problem is at the final level at "strtok"... first i split it, then in subsequent call when doing strtok(NULL," "); it works ok. the problem is when i add the second string "poly_buffer"... seems it works on it.... #include "stdafx.h" #include <iostream> #include <cstdio> ...

How do I convert strings starting with numbers to numeric data in XSLT?

Given the following XML: <table> <col width="12pt"/> <col width="24pt"/> <col width="12pt"/> <col width="48pt"/> </table> How can I convert the width attributes to numeric values that can be used in mathematical expressions? So far, I have used substring-before to do this. Here is an example template (XSLT 2.0 only) that shows...

Return array value as NSString

How can you return an array value (witch is a number) as a string? Current code: return [numbers objectAtIndex:row]; Have also tried: return @"%@", [numbers objectAtIndex:row]; With no luck.. Thanks :) PS: Yes, I am stupid. (: ...

How do I iterate "between" items in an array / collection / list?

This problem has bugged me for years, and I always feel like I'm coming up with a hack when there's a much better solution. The issue at hand occurs when you want to do something to all items in a list and then add something inbetween those items. In short, I want to: Do something to every item in the list. Do something else to all b...

TCHAR[], LPWSTR, LPTSTR and GetWindow Text function

So the GetWindowText is declared on MSDN as follows: int GetWindowText( HWND hWnd, LPTSTR lpString, int nMaxCount ); However for the code to work we have to declare the second parameter as TCHAR[255] WTitle; and then call the function GetWindowText(hWnd,Wtitle,255); The LPTSTR is a pointer to an array of tchar, so...

Since strings are immutable, do variables with identical string values point to the same string object?

a) string s = "value"; string s1 = "value"; Do s and s1 reference variables point to same string object ( I’m assuming this due to the fact that strings are immutable )? b) I realize equality operators ( ==, > etc ) have been redefined to compare the values of string objects, but is the same true when comparing two s...

Write Chinese chars to a text file using vbscript

I'm trying to write some Chinese characters to a text file using Set myFSO = CreateObject("Scripting.FileSystemObject") Set outputFile = myFSO.OpenTextFile(getOutputName(Argument, getMsiFileName(Wscript.Arguments)), forWriting, True) outputFile.WriteLine( s ) variable s contains Chinese character that I read from other file. I echo ...

Where can I get started with Unicode-friendly programming in C?

So, I’m working on a plain-C (ANSI 9899:1999) project, and am trying to figure out where to get started re: Unicode, UTF-8, and all that jazz. Specifically, it’s a language interpreter project, and I have two primary places where I’ll need to handle Unicode: reading in source files (the language ostensibly supports Unicode identifiers a...

Is there an easy way to split a String with a String in C#

I would like to split a string into a String[] using a String as a delimiter. String delimit = "[break]"; String[] tokens = myString.Split(delimit); But the method above only works with a char as a delimiter. Any takers? ...

C#: Parse substring from a string by detecting whitespace.

If I have various strings that have text followed by whitespace followed by text, how can I parse the substring beginning with the first character in the second block of text? For example: If I have the string: "stringA stringB" How can I extract the substring "stringB" The strings are of various lengths but will all be of...