以编程方式创建Unicode?(Programmatically Create Unicode?)
给定一个十六进制
String
,我如何以编程方式创建一个UnicodeString
?例:
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 UnicodeString
?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
-
您的代码似乎是正确的,但是如果您尝试使用ajax()函数从另一个页面获取内容? 因为你必须得到一个标签,然后你可以轻松地附加它。 $.ajax({ url: '../index.html', dataType: 'html', success: function(html) { var div = $('#header1', $(html)).addClass('done'); $('#indexHeader1').html(div); } }); 试一试。 编辑我已经使 ...
-
在检查元素是否存在之前,您必须实际获取数据。 您不能使用load() ,因为它直接插入数据,但它只是$.get的快捷方式,因此您可以使用它,并检查元素是否存在,如果它确实插入,如果不插入另一个要素: $.get('getweather2.php?wx=1', function(html) { var el = $('').append(html); if ( el.find('#warning').length ) { $('#wxwarning').html( ...
-
使用函数Load jquery(use the function Load jquery)[2023-05-24]
因此,从其他元素中删除内容 $("#modalcookieslink").click(function(){ $('#modaloffres').html(""); $('#modalcookies').load('modif.html #cookies'); }); $("#modaloffreslink").click(function(){ $('#modalcookies').html(""); $('#modaloffres').load('modif.html ... -
尝试在此包装所有的代码: $(document).ready(function() { // your code } 当代码只是在页面加载时运行时,会遇到您正在查找的内容尚未准备好使用(甚至可能尚未下载)的情况。 因此,请确保您在运行代码之前等待页面加载。 编辑 这可能是“$(window).load(pageid);” 只是错误的代码,但如果事情仍然不奏效,你必须对你的目标更具体。 像这样的东西: