在开始中将整数插入阿拉伯字符串 [英] Insert integer to Arabic String in Start

查看:29
本文介绍了在开始中将整数插入阿拉伯字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试向阿拉伯字符串添加整数但没有成功

I am trying to add integer to Arabic string but no success

// Arabic String  
Astr = "سُوْرَةُ الْفَاتِحَة";
// String with Integer   -1
num = "-"+1;
// Adding Strings
r = Astr + num;  
r = num + Astr;

输出:سُوْرَةُ الْفَاتِحَة-1

所需的输出:

سُوْرَةُ الْفَاتِحَة‎-1

我想要右边的整数.

更新:我使用 Items.Insert() 方法在 Visual Studio 中的 ListBox 中显示这个结果,所以如果有人知道调整 ListBox 那么请分享我的意思是ListBox 每行显示数字 1 2 3 4 ?

Update : Am displaying this result in ListBox in visual studio by using Items.Insert() Method , so if anyone know to tweak ListBox then kindly share I mean if ListBox display Numbers 1 2 3 4 with each row ?

推荐答案

使用 Unicode LRM (200F)

Use Unicode LRM (200F)

string Astr = "سُوْرَةُ الْفَاتِحَة";
var num = "-1";
var LRM = ((char)0x200E).ToString(); 
var result = Astr + LRM + num;

你会得到:result = "سُوْرَةُ الْفَاتِحَة -1"

请参阅:如何:格式化控制字符

LRM ==> 从左到右的标记 ==> 200E ==> 充当拉丁字符.

LRM ==> Left-to-Right Mark ==> 200E ==> Acts as a Latin character.

这篇关于在开始中将整数插入阿拉伯字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆