微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

字符串未更改为大写

如何解决字符串未更改为大写

我想知道为什么我没有得到想要的输出? 我的代码-

import { persistStore } from 'redux-persist';
import createSagaMiddleware from 'redux-saga';

import createStore from './createStore';
import persistReducers from './persirstReducers';

import rootReducer from './modules/rootReducer';
import rootSaga from './modules/rootSaga';

const sagaMonitor = __DEV__ ? console.tron.createSagaMonitor() : null;

const sagaMiddleware = createSagaMiddleware({ sagaMonitor });

const middlewares = [sagaMiddleware];

const store = createStore(persistReducers(rootReducer),middlewares);
const persistor = persistStore(store);

sagaMiddleware.run(rootSaga);

export { store,persistor };

输出-

?????? = ['????','????????']
for i in ??????:
  print(i.upper())
print(??????)

所需的输出-

????
????????
['????','????????']

解决方法

您的单词是用数学大写字母字体写的,没有大写字母:

hex(ord(mylist[0][0]))
#'0x1d68f'
hex(ord('f'))
#'0x66' - this is the "normal f"
mylist[0][0] == 'f'
# False

因此,从技术上讲一切正常:i.upper()i转换为大写,但是由于没有大写字母,因此转换的结果是相同的字符串。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。