首页 \ 问答 \ 以编程方式创建Unicode?(Programmatically Create Unicode?)

以编程方式创建Unicode?(Programmatically Create Unicode?)

给定一个十六进制String ,我如何以编程方式创建一个Unicode String

例:

def f(x: String): String = s"\u$s"

无法编译:

scala> def f(x: String): String = s"\u$s"
<console>:1: error: error in unicode escape
       def f(x: String): String = s"\u$s"
                                      ^

我尝试了以下,但失败了:

scala> def f(x: String): String = "\\u" + x
f: (x: String)String

scala> f("0021")
res19: String = \u0021

scala> "\u0021"
res20: String = !

scala> res19 == res20
res21: Boolean = false

Given a hex String, how can I programmatically create a Unicode String?

Example:

def f(x: String): String = s"\u$s"

fails to compile:

scala> def f(x: String): String = s"\u$s"
<console>:1: error: error in unicode escape
       def f(x: String): String = s"\u$s"
                                      ^

I tried the following, but it failed:

scala> def f(x: String): String = "\\u" + x
f: (x: String)String

scala> f("0021")
res19: String = \u0021

scala> "\u0021"
res20: String = !

scala> res19 == res20
res21: Boolean = false

原文:https://stackoverflow.com/questions/40601538
更新时间:2023-06-19 15:06

最满意答案

凯文B是对的:

$('#colTwo').load(page_url + ' #colTwo');

只需将选择器作为字符串添加到URL中,不要忘记空间!


Kevin B is correct:

$('#colTwo').load(page_url + ' #colTwo');

Just add the selector as a string to the URL, and don't forget the space!

相关问答

更多
  • 尝试在检索数据后重置#mainHTML的高度: $('#mainContent').load('test.html', function() { $("#mainHTML").stop().css({height: 'auto'}); }) http://jsfiddle.net/KzEpL/ http://jsfiddle.net/KzEpL/1/ Try to reset the height of the #mainHTML after retrieving data: $('#mainCont ...
  • 我会用$.ajax()调用来做: $('document').ready(function(){ $(".beautific").click(function(){ $.ajax({ url: "beautific/beautific.html #beautific_hype_container", }).done(function ( data ) { $(".edgeContent").html(data); }); }); }); 这样您的脚本 ...
  • 你现在应该使用jQuery function print_country(country_id){ // given the id of the