mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-11-01 01:25:27 +08:00 
			
		
		
		
	Add extension method to get the cell width of a character
This commit is contained in:
		 Patrik Svensson
					Patrik Svensson
				
			
				
					committed by
					
						 Patrik Svensson
						Patrik Svensson
					
				
			
			
				
	
			
			
			 Patrik Svensson
						Patrik Svensson
					
				
			
						parent
						
							49e8a980a7
						
					
				
				
					commit
					48d49d6e18
				
			
							
								
								
									
										18
									
								
								src/Spectre.Console/Extensions/CharExtensions.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								src/Spectre.Console/Extensions/CharExtensions.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,18 @@ | ||||
| namespace Spectre.Console | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Contains extension methods for <see cref="char"/>. | ||||
|     /// </summary> | ||||
|     public static class CharExtensions | ||||
|     { | ||||
|         /// <summary> | ||||
|         /// Gets the cell width of a character. | ||||
|         /// </summary> | ||||
|         /// <param name="character">The character to get the cell width of.</param> | ||||
|         /// <returns>The cell width of the character.</returns> | ||||
|         public static int GetCellWidth(this char character) | ||||
|         { | ||||
|             return Cell.GetCellLength(character); | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user