How to write special characters in vb.net console [duplicate] - vb.net

This question already has answers here:
How to represent Unicode character in VB.Net String literal?
(7 answers)
Is it possible to get a copyright symbol in C# Console application?
(5 answers)
Closed 6 years ago.
How do i output special characters to the console in visual basic. because simply putting console.writeline("Copyright symbol") outputs a C instead of the symbol. how can i fix this.

You can use the ChrW() function with the Unicode decimal value of the symbol you want to print, for the Copyright symbol it is 169.
console.writeline(ChrW(169))
You can find the Unicode decimal values for other symbols on this website.

The real copyright symbol is a unicode character. Use \u00A9 instead of C to print it out correctly.

Related

decode this regex [duplicate]

This question already has answers here:
What do comma separated numbers in curly braces at the end of a regex mean?
(6 answers)
Closed 3 years ago.
I've tried to understand the below but don't seem to get the last part of the regular expression which has {1,40}. Overall, I know the pattern tries to match the special characters and something else (the {1,40})
regexp_like(COLUMN,'^['||UNISTR('\0020')||'-'||UNISTR('\0060')||UNISTR('\007B')||UNISTR('\007D')||UNISTR('\007E')||UNISTR('\00C0')||'-'||UNISTR('\00DF')||']'||'{1,40}$')
regexp_like() checks that a string matches the regex provided as second argument.
Your regexp looks like ^[...]{1,40}$.
^ is the beginning of the string and $ is the end, so the entire string must match the regex.
[...] is a character class, that contains a bunch of characters code points. All characters of the string must belong to that list (any other character is forbiden). You would need to to check what they correspond to: unicode.org is your friend. For the first code points:
\0020 space
\0060 grave accent
\007B left curly bracket
finally, {1,40} is a quantifier: the length of the string must be at least one and at most 40.

Why is DATE_AND_TIME integer result printed with spaces and how can I trim them? [duplicate]

This question already has answers here:
Smart printing of integers in fortran90
(1 answer)
Integer output formatting with print statement
(3 answers)
Output formatting: too much whitespace in gfortran
(2 answers)
Closed 5 years ago.
I'm attempting to get a time stamp with DATE_AND_TIME(), but Fortran returns an excessive amount of spaces, and I can't seem to trim these spaces because functions like TRIM() and ADJUST() work on strings only. Fortran appears to not have a function to convert integers to strings or at least I haven't been able to find one so far. I'd like to use the date-time stamp in a file name, so the included spaces are a problem. Can anyone show me how to remove these additional spaces?
Unfortunately I have to use Fortran, although I believe other versions of Fortran are acceptable.
Code:
program
character(8) :: date
character(10) :: time
character(5) :: zone
integer, dimension(8) :: values
zone = "+01"
call date_and_time(ZONE=zone,VALUES=values)
print *, "values(1)", values(1), "-"
Returns (including text before and after values(1) to show spacing):
values(1) 2017 -
As shown above there seem to be about 6 spaces before the number.
I'm compiling this in gfortran, version is: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5)

Get a unicode value of a character [duplicate]

This question already has answers here:
numerical value of a unicode character in objective c
(2 answers)
Closed 9 years ago.
I have a character being entered by the user in a textfield and as per the functionality I have in my code, the system should append the same character at the end of a string. So if the user enters '$', the system adds '$' so I get '$$' on the textfield.
I want get the unicode or ascii value of the '$' character entered by the user. How do I check for it?
There is no reason to get the Unicode value of the character for what you are trying to accomplish. Implement the appropriate UITextFieldDelegate method and see if the text ends with $:
if ([someString hasSuffix:#"$"]) {
// add another dollar sign
}

Is there a way to use math symbol? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
UILabels and Unicode
Is there a way to use math symbols in UILabels and UITextField just like the html ÷ × −, ° etc.?
Just drag the symbols from Mac OS X' Character Viewer to Xcode. Than it should look like
label.text = #"÷ × −, ° ";
No need to deal with codes or html-entities.
If you have html-entities in your text, this category might be helpful: GTMNSString+HTML
You can't use the HTML encodings, but you can embed the actual symbols directly into your code or your XIB files as Xcode treats Objective-C source files as Unicode / UTF-8.
To convert a string myHTMLString which has the encoded symbols, use
NSString* convertedString = [myHTMLString stringByDecodingHTMLEntities];
and use this NSString* category: (Just include "NSString+HTML.m" in your source) https://github.com/mwaterfall/MWFeedParser/blob/master/Classes/NSString+HTML.m

VB.NET function for uppercasing the first letter of each word [duplicate]

This question already has answers here:
How to uppercase the first character of each word using a regex in VB.NET?
(9 answers)
Closed 8 years ago.
I'm looking for do this in VB.NET,
hy how are you
to,
Hy How Are You
Anyone have any idea?
This following will do what you want without using regex (and is more readable than a regex solution):
Dim s As String = "some sentence that i want to capitalise"
Debug.WriteLine(Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(s))
Output:
Some Sentence That I Want To Capitalise
And you can also do this (from the Microsoft.VisualBasic Namespace):
Debug.WriteLine(StrConv(s, VbStrConv.ProperCase))
You can do that using regular expressions. There are a useful class named Regex that will help you a lot. Please follow this link for more information.