What character to use to put an item at the end of an alphabetic list?

风格不统一 提交于 2019-11-28 14:07:21

问题


I often prepend '_' to the item I want in first position.
Is there some sort of magical character I could use to put an item at the end of the list?

Something more elegant than "z_item".

From

  • _custom folder1
  • _custom folder2
  • Inbox
  • Sent box
  • Spam folder

To

  • Inbox
  • Sent box
  • Spam folder
  • [?]custom folder1
  • [?]custom folder2

Yeah, it's COT-ish.


回答1:


The Special lead-in Character that will put your folder at the end of the list without having to resort to using the "z" combo: U+E83A: Private Use. In fact, I believe any of the Private Use characters will work. () Just copy and paste the character between the brackets.




回答2:


I found this thread while wanting folders that sort after Z in Finder on Mac OSX. After several false paths and trial and error, here's what I found:

Characters that sort after Z in Finder (in sort-order)

  • z Lower case Z
  • ι Greek letter
  • Ι Greek letter, capital version of above character, not an "I")
  • Ω Omega
  • 一 Japanese Character? (Thanks, Jam)
  • 口 Japanese character? (Thanks, Jam)
  • 末 Japanese character "End" (Thanks, Jam)
  •  (a private use character) (Thanks, Peter O.)

These are characters others here and in other places on the web, mentioned sort after Z, but that I found DO NOT sort at the end, at least when sorting by name in Finder on Mac:

† ∆ ~ - ſ [ ø ■ |




回答3:


Based on code page 437, here is a list of characters that come after z. Note they are listed in sort order. Omega is probably the most appropriate for this use case, because it is the last letter of the Greek alphabet.

α  alpha        U+03B1  Alt 224
Γ  gamma        U+0393  Alt 226
δ  delta        U+03B4  Alt 235
ε  epsilon      U+03B5  Alt 238
Θ  theta        U+0398  Alt 233
π  pi           U+03C0  Alt 227
Σ  sigma upper  U+03A3  Alt 228
σ  sigma lower  U+03C3  Alt 229
τ  tau          U+03C4  Alt 231
Φ  phi upper    U+03A6  Alt 232
φ  phi lower    U+03C6  Alt 237
Ω  omega        U+03A9  Alt 234



回答4:


Despite being years later I wanted to contribute as none of the previously provided answers worked for me. For reference I'm running win7 ultimate SP1.

The solution I landed on resulted from noticing that any files I made for use with Japanese speaking contacts ended at the end of the file list. Apparently Japanese characters don't count as non-alphanumeric similar to hashmark, hyphen, underscore (which place files at the beginning of the list), but also come after English characters.

For my own use I ended up using the 末 character, which roughly means "end" so it makes sense to Japanese readers and is still different enough from English to not become confusing.

Alternatively I would use 口 or 一 for something more stylistically apparent. It's also worth noting that the shorthand "maru" character ○ does not work and sorts along with other non-alphabet characters at the head of the list.




回答5:


Don't mess up things using strange characters!

I would not suggest using Private Use characters or non-printable characters because they can really mess up the things when you access your folder from terminal or programming languages. I had annoying issues using 末 or other special characters. For example, using Python 2.7, this is how you will see your folders with the non-printable characters Ω, 末, 口,.

os.listdir(os.getcwd())
Out[2]: ['\xe6\x9c\xab ', '\xe5\x8f\xa3 ', '\xce\xa9 ', '\xee\xa0\xba ']

For someone or something using your folder structure, accessing the folder would be very confusing (and you can see it from the comments like this to the top answer).

So I created a folder with this at the beginning of the name on my Sharepoint drive and now it's there and I can't access it or delete it. :| – Rather Notsay Jun 28 '16 at 21:05

Of course, you can print them, but why make the things so unnecessarily complex? If you want to stay on the safe side, I would suggest using standard characters. Which is the last one depends on your File manager. So here is some code that creates a bunch of folders with all the printables strings in Python so you can test your file manager.

import os
import string
for i in string.printable:
      try:
            os.mkdir(i)
      except OSError:
            print 'OSError for %s' %(i)

Once you have sorted by name you can get your answer.

For Windows 10 - Explorer

using standard characters after z up to my knowledge there is only zz and so on.

So using zzNameOfTheFolder is an easy and safe way do to that. So even if it's not nice I would recommend it.

For Ubuntu 16.04 - Nautilus

The hashtag # is the last character. But if you want some more compatibility with others file managers I would use ZZ.

Something more elegant than "z_item"?

I guess this depends on your own concept of elegance and I think StackOverflow should diffuse best and safest practices, not the most elegant. However, in many cases, symmetry can help. What about these safe perhaps more elegant solutions:

ZZFoldernameZZ
Zz-Folder name-zZ
zZ-Folder name-Zz
zZFolderNameZz
zzFoldernamezz



回答6:


no one mentioned ٴ. This is an Arabic character and sorts below z. Because it's very small, it doesn't annoy.




回答7:


I've found two characters that will put your folders at the bottom of the list. The first is "ι" and its variant "Ι". Also, the two best characters to put your folders at the front of the pack are either the No-break space " " and the bullet "·"

For the novice user (like me) who might have found this question and these answers by accident, here's a simple explanation of how to type these characters. The first is literally a space created by holding the "Alt" key & typing "0160" on your number pad and the second is the "Alt & 250" combination  (Note: A 10-key number pad is best. If you don't have one on your keyboard, see if you can figure out how to use the alternate number keypad. This is almost always different than the 1-0 keys at the top of your keyboard. Look for tiny numbers printed on the edges of your keyboard -usually the "M" "J" L" "I" "O" "P" & 7-0 keys). Or, of course, you can copy and paste the characters in the quotations above (not as easy if you frequently use them as I do).

Here's a short list of special characters to both prioritize your folders or have them appear at the end of a folder list as well as some other folder-friendly characters. Enjoy (~Peter II)

Useful Characters for Windows Explorer

     0160            No-Break Space

·    249/0183    Middle Dot

·    250/8729    Bullet operator

◦    9702           White bullet

›    0155/8250   (See Above)

∕    8275            Division slash

ι                       (End Character)

Ι                      (End Character)

✓  2713?        Check Mark

׃    Last but not least, this alt key (1475) is Hebrew Punctuation Sof Pasuq -This is a great character to use when you can be used in place of a colon)




回答8:


Using cp1252 and unless you're using the letters ø ù ú û ü ý þ ÿ alot, ÷ seems to be an option...

Edit: Using unicode, ■ (\uffed) might also be a possibility, unless you are writing a lot in Linear-B...




回答9:


I use:
_ (underscore) to sort before the alphabet and
- (hyphen) to sort after the alphabet.

(Works with czech sorting in Windows explorer and Total commander.)


edit: Windows 7 and later sort the hyphen - as if the hyphen wasn't there.




回答10:


For web and SQL purposes, pre-pending CHAR(127) forces text to the bottom and adds no visible character. Works at least for our use of SQL and the jQuery datatables plugin.




回答11:


Most answers here suggest a non-standard character, which will sooner or later cause issues with various systems.

One answer here, which in my opinion is the best, out of all existing to the moment, is to use the last standard character available on your system. For most of us, that's just z. This solution is already suggested by the question and it is indeed not very elegant.

My elegant solution is to use a thesaurus to come up with alternative folder names that sort accordingly. Want your Archives folder to be last, rather than first, maybe Museum will do it, or perhaps Smithsonian, otherwise Zipped works for sure.

Of course, this solution involves a bit of extra work, but it is elegant, it expands your vocabulary, and it might bring you a bit of joy in your work.




回答12:


Another approach is to use a right to left character, for example an Aramaic letter, so that the sorting character appears at the end rather than the front. For example, I've chosen Zayin https://graphemica.com/𐡆

So, typing in:

𐡆 Alpha

is rendered by the text engine as:

Alpha 𐡆

With the word now sorted below a folder named 'z'.

The full unicode details are:

𐡆
IMPERIAL ARAMAIC LETTER ZAYIN
Unicode: U+10846, UTF-8: F0 90 A1 86

Note: I've tested this on MacOS, not every text renderer correctly handles right to left languages.




回答13:


Those that find that most of the codes given here produce different characters than what is described, you probably have  EnableHexNumpad    enabled in  HKCU \ Control Panel \ Input Method... this is by and large a  good  thing, but you do have to convert the codes to hex and precede them with '+' sign (on the num keypad), eg. for the colon at Alt+1475, use the hex equivalent of Alt+5C3 ( hit  Alt   with the left hand and hold it down, then with the right hand hit the keypad  +  … then  5  , C  , and  3  … then let go of  Alt   ).

And, speaking of colons, there's another (smaller) good colon at Alt+1361 hex, which would be Alt+4961 without HexNumpad if  it works that way.



来源:https://stackoverflow.com/questions/8086375/what-character-to-use-to-put-an-item-at-the-end-of-an-alphabetic-list

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!