I am getting some problem while getting below output.
Expected OutPut :
a2,3 = a\u00B2\u066B\u00B3
Actual Output :
a2,3 = a\u00B2\u066B\u00B3
Kindly review my question and reply soon.
Thanks in advance
There's no Superscript comma in Unicode.
However there are :
Superscript plus sign (U+207A): ⁺
Superscript minus sign (U+207B): ⁻
Superscript equals sign (U+207C): ⁼
Superscript left parenthesis (U+207D): ⁽
Superscript right parenthesis (U+207E): ⁾
Maybe you can use some other glyph, like the "dot operator" (U+22C5) to simulate a superscript comma: ¹⋅³².
You can also, of course, use NSAttributedString with a smaller font-size and an up-shifted baseline offset to simulate superscripting. However NSBaselineOffsetAttributeName is only available starting with iOS 7.
Related
If you try **b.**a on https://spec.commonmark.org/dingus/, you would see its b. is not bolded.
However, if you just omit the last a, it works.
What is the CommonMark format to bold it correctly (that is bolded a., followed by unbolded b)?
The solution to format the text correctly in CommonMark.
According to section 6.2 of the CommonMark specification, that behaviour is by design:
A delimiter run is either a sequence of one or more * characters [...]
A right-flanking delimiter run is a delimiter run that is (1) not preceded by Unicode whitespace, and either (2a) not preceded by a Unicode punctuation character, or (2b) preceded by a Unicode punctuation character and followed by Unicode whitespace or a Unicode punctuation character.
You can get the desired visual appearance with **b.**a, where is the HTML entity "zero-width joiner", thus:
**b.**a
...and we've just found a bug in the rendering here on Stack Overflow. In edit mode, the preview shows it correctly as
I want to add comma in spread sheet as a superscript like :
in this ->> ¹,²
comma is not as superscript. Is there any way out for comma to be added as superscript in google spreadsheet?
For 1 and 2 and many others, there is a function available in sheet like =char(178)
however I am ot able to find the code for comma.
Answer:
As there is no Unicode for a superscript comma, you can not do this.
More Information:
Not all characters have superscript-versions set in unicode. You can see the full list of available superscript characters here.
You can either use the dot operator (U+2265) ⋅, or the modifier letter apostrophe (U+02BC) ʼ as separators instead, if you wish to hard code this. I am of the personal opintion that the dot operator looks more like a comma, but they both appear as below:
¹⋅² (dot operator)
¹ʼ² (modifier letter apostrophe)
As Google Sheets isn't a word processing application, there is no direct in-built way to make text appear as superscript, akin to <sup>1,2</sup> in HTML:
1,2
References:
Unicode subscripts and superscripts - Wikipedia
I need to use non printable characters in a String constant, but Xcode shows error in my swift file as "Unprintable ASCII character found in source file"
My Simple code is below
let unprintableCharInString = "12345"
You could see the non printable characters at prefix and suffix of above string value, If you just copy paste my above code in Sublime text or some other text editor which supports to show Unprintable characters.
But if you paste the above code in Xcode swift file, you will see the compiler error "Unprintable ASCII character found in source file".
And if I use the same string in Objective C as like below, there is no error.
NSString *unprintableCharInString = #"12345";
So how to use non printable characters in Swift string variable directly as like above Objective C code?
Note:
As the body text box trims those non printable chars while saving my question, you can't see those chars if you copy paste the code from here. Instead of that try to copy the above code by editing my question. So you can get those chars in Body text box during edit.
Screenshot from Sublime Text editor:
Thanks in advance!
To display space characters you can use XCode Editor > Show Invisibles. But I'm not really sure will it help in your case.
Based on the #Alladinian's suggestion in Comment above,
Answer is: We need to add the unprintable ASCII characters manually in source code while declaring string value.
Example:
let unprintableCharInString = "\u{02}123\u{1A}"
Here \u{02} is Hex value of "START OF TEXT (STX)" and \u{1A} is Hex value of "SUBSTITUTE (SUB)"
Thanks #Alladinian!
I have a label which shows an expression:
(x+y)
But I want to show it in label like this:
(x+y)^2
(But with degree, I can't do it here, because I have too low reputation to insert images)
So, I want to show expression's degree in UIlabel.
Is it possible with single UILabel?
You can use Unicode characters of superscript two \u00B2, it it's always \u followed by the character code.
NSString *equation = [NSString stringWithFormat:#"(x+y)%#", #"\u00B2"];
Swift:
var equation = NSString(format:"(x+y)%#", "\u{00B2}") as String
Result:
http://unicode-table.com/en/
Strings and Characters (Apple iOS Developer Library )
Strings in Swift
I think you are looking for powers e.g. (x + y)⁹.
For this, You have to use unicodes.
you can take list of unicodes character list from here;
http://www.fileformat.info/info/unicode/category/No/list.htm
In code, you will use;
print("(x+y)\u{00B2}");
I don't understand why this token doesn't work. The token is this:
TEXT = [a-zA-Z0-9-_,;. \t\r\n\r\n]+
The token TEXT must recognize some text, with whitespace and new lines. For example the following token works:
TEXT = [a-zA-Z0-9-_,;. \t]+
How can i do to add the possibility of new lines in the token TEXT?
(Answered as a Community Wiki so that question shows an answer: See Question with no answers, but issue solved in the comments (or extended in chat) )
#user3640434 reported he found the correct regular expression for TEXT. It recognizes whitespace and new lines:
TEXT= ((\r\n|\r|\n)*[a-zA-Z0-9\-_,;. \t](\r\n|\r|\n)*)*
#Rob11311 Noted:
If you have a separate token rule WHITE =[ \t\n\r]+ does that work to match 1 or more whitespace items? Can you explain why you've added \r & \n twice into the char class? BTW you might want \f, \b and \v as whitespace to (formfeeds, backspace, vertical tab). Does char class help? [[:alnum:]-_,;.[:space:]] ?